Jquery 切换跳转
Jquery toggle jumps
有人可以告诉我这个问题的解决方案吗?可以看到,使用Toggle函数时的div "jumps"。
http://codepen.io/AndrewRed/pen/vErjob?editors=101
<p>Text above animation</p>
<input type="button" class="btn" Value="Animate"/>
<div id="animate">
<p>Text to animate</p>
<p>Text to animate 2</p>
</div>
<p>Text below animation</p>
$("input").on('click', function(){
$("#animate").toggle('slow');
});
您应该删除 p 标签的边距:
p {
margin: 0;
}
有人可以告诉我这个问题的解决方案吗?可以看到,使用Toggle函数时的div "jumps"。 http://codepen.io/AndrewRed/pen/vErjob?editors=101
<p>Text above animation</p>
<input type="button" class="btn" Value="Animate"/>
<div id="animate">
<p>Text to animate</p>
<p>Text to animate 2</p>
</div>
<p>Text below animation</p>
$("input").on('click', function(){
$("#animate").toggle('slow');
});
您应该删除 p 标签的边距:
p {
margin: 0;
}