slideUp('slow')
和 hide('slow')
会产生相同的动画效果吗?
示例代码:
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide('slow');
});
$("#show").click(function(){
$("p").show('slow');
});
});
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
最佳答案
没有。
.slideUp('slow')
将高度和垂直内边距动画化为零。
.hide('slow')
还将宽度、水平填充和不透明度设置为零。
要查看差异,请将 javascript:void($('pre').hide(4000))
粘贴到本页的地址栏中。
关于jquery - jQuery的hide和slideUp方法是等价的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5290152/