jQuery的切换左到右动画 [英] Jquery toggle Left to right animation
本文介绍了jQuery的切换左到右动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个jQuery的切换动画,但由于某种原因,它不工作。
I have created a jquery toggle animation but for some reason it isn't working.
任何人都可以有所帮助?
Can Anyone be of assistance?
请参阅更新的小提琴。
类=搜索容器缠绕意指滑出从左到右
Please see updated fiddle. class="search-container-wrap" is meant to slide out from left to right
/* SHOWS CHART SEARCH
===================================================================*/
$(document).ready(function(){
$('.search-charts-go').click(function (e) {
e.stopPropagation();
$('.search-container-wrap').hide('slide', {direction: 'left'}, 500);
$(this).next('.search-container-wrap').stop().show('slide', {direction: 'left'}, 500);
});
});
多谢!!!!
推荐答案
您的问题在于 $(本)。接下来(搜索容器外包装')
自从被点击的锚没有这样的兄弟姐妹。尝试 $('搜索,容器包装')
所示的这个小提琴。
Your problem lies in $(this).next('.search-container-wrap')
since the anchor being clicked doesn't have such a sibling. Try $('.search-container-wrap')
instead as shown in this fiddle.
我把使其滑进滑出还有的自由。
I took the liberty of making it slide in and out as well.
这篇关于jQuery的切换左到右动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文