我想知道是否可以将过渡添加到 html 元素位移中? 为了解释它,假设有一个警告框(我正在使用 Bootstrap),当用户单击那个小“x”将其关闭时,位于警告框下方的其他元素大致向上移动。
这只是一个示例表单。如果可能的话,我想让这个 Action 顺利进行。
最佳答案
$('body').on('click','.somethinghashappened', function(e) {
$(this).fadeOut(500,function(){
$(this).css({"visibility":"hidden",display:'block'}).slideUp();
});
});
它淡出然后警报 block 设置为显示 block ,然后向上滑动那个(警报) block ,这会导致向上滑动你的 div。//
你可以检查这个 fiddle ,其他一些高手已经这样做了! :) Create smooth transition of block elements when removing sibling elements from DOM
关于jquery - 置换时向 div 添加过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24890855/