简体   繁体   English

使用JQuery SlideToggle的问题

[英]Issues using JQuery SlideToggle

Im getting a "Flicker" effect while using SlideToggle: 我在使用SlideToggle时获得了“闪烁”效果:

        $("#Box").children().hide();
        $(".Box_Child").stop(true, true).slideToggle(1500);

Where there are roughly 10 or so ".Box_Child" 大约有10个左右的“ .Box_Child”

I'm using JQuery 1.9.1 All Browsers produce the effect. 我正在使用JQuery 1.9.1,所有浏览器都会产生效果。 The above causes the div to hide, slide up, and then reappear instead of hiding and then sliding down. 上面的内容导致div隐藏,向上滑动,然后重新出现,而不是隐藏然后向下滑动。 Any help would be much appreciated. 任何帮助将非常感激。

Here's a fiddle: http://jsfiddle.net/SxRQN/1/ 这是一个小提琴: http : //jsfiddle.net/SxRQN/1/

Sorry for the nonsense @Kevin B and @j08691, it seems as though that particular animation did not like the fact that I had the block display listed as important. 抱歉@Kevin B和@ j08691废话,似乎该特定动画不喜欢我将块显示列为重要事实。 It was most likely conflicting with the css modification and ultimately the direction of the animation. 这很可能与CSS修改冲突,最终与动画的方向冲突。 SlideToggle automatically finds whether your div is positioned up or down. SlideToggle自动查找您的div是向上还是向下。

To fix the fiddle, and my page, I just removed !important. 要修复小提琴和我的页面,我刚刚删除了!important。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM