我已经多次这样做而没有问题,但出现了问题,在这里。下滑将开始正常工作(1/3),然后突然抽搐并完成动画。向上滑动正常工作。对于slideDown()、slideToggle和.animate()都是如此。
奇怪的是,如果我在动画函数中切换不透明度,它就不会抽搐,但我的文本会短暂地改变颜色。
HTML:
CSS:我在其他地方阅读到,边距可能会引起不流畅的情况,但这并没有帮助解决问题。
HTML:
<h2>Phthalate Free: </h2><div class="yamikowebsToggler">
<p>
Dibutyl Phthalate is linked to cancer and is present in nail polish, perfume, soft plastics and skin care products.
</p></div>
CSS:我在其他地方阅读到,边距可能会引起不流畅的情况,但这并没有帮助解决问题。
h2{color:#76DEFC; margin:0px;}
.yamikowebsToggler{margin:0px;}
p{margin:0px; color;#000000;}
JQUERY:
$(document).ready(function(){
$(".yamikowebsToggler").fadeOut(0);
$("h2").click(function()
{
$(this).next(".yamikowebsToggler").stop(true, true).animate(
{ height: 'toggle' },
{
duration: 1000,
});
})
});