【发布时间】:2011-07-18 23:44:25
【问题描述】:
我已经多次这样做了,但由于某种原因,这是Here 的问题。向下滑动将开始正常工作(1/3),然后突然猛拉并完成动画。向上滑动效果很好。这是 slideDown()、slideToggle 和 .animate() 的情况 奇怪的是,如果我还在动画函数中切换不透明度,它不会抖动,但我的文本会短暂改变颜色。
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;}
查询:
$(document).ready(function(){
$(".yamikowebsToggler").fadeOut(0);
$("h2").click(function()
{
$(this).next(".yamikowebsToggler").stop(true, true).animate(
{ height: 'toggle' },
{
duration: 1000,
});
})
});
【问题讨论】:
-
我没有看到问题:jsfiddle.net/azjUT 啊——刚刚注意到你的链接,那里有问题。我认为它一定是与其他一些 CSS 的交集,因为单独使用这段代码没有任何问题。
标签: javascript jquery jquery-animate slidetoggle slidedown