单击时如何重新绑定jcarouselite?

时间:2012-07-24 14:56:22

标签: jquery

这是我的第一篇文章,所以希望你能同情我!!

当我动态绑定它时,我遇到了jcarousellite的问题。

我的标记看起来像这样:

 <div class=outside1>
<ul>
<li>something here</li>
<li>something here</li>
<li>something here</li>
<li>something here</li>
</ul>
</div>
 <div class=outside2>
<ul>
<li>something here</li>
<li>something here</li>
<li>something here</li>
<li>something here</li>
</ul>
</div>
 <div class=outside3>
<ul>
<li>something here</li>
<li>something here</li>
<li>something here</li>
<li>something here</li>
</ul>
</div>

<div class="nav">
<a class="page1"></a>
<a class="page2"></a>
<a class="page3"></a>
</div>

<script type="text/javascript">  
    jQuery(window).load(function () {        
                jQuery(function () {
                    jQuery("div.outside1").jCarouselLite({                                 
                        mouseWheel: true,
                        //auto: 800,
                        speed: 1000,
                        easing: "easeOutBounce",
                        visible: 7
                    });
           });
jQuery('.page1').click(function () {
        setTimeout(function () {
                jQuery("div.outside1").jCarouselLite({                                    
                        mouseWheel: true,
                        //auto: 800,
                        speed: 1000,
                        easing: "easeOutBounce",
                        visible: 7
                    });                              
            }, 5000);
  });
jQuery('.page2').click(function () {
        setTimeout(function () {
                jQuery("div.outside1").jCarouselLite({                                    
                        mouseWheel: true,
                        //auto: 800,
                        speed: 1000,
                        easing: "easeOutBounce",
                        visible: 7
                    });                              
            }, 5000);
  });
jQuery('.page3').click(function () {
        setTimeout(function () {
                jQuery("div.outside1").jCarouselLite({                                    
                        mouseWheel: true,
                        //auto: 800,
                        speed: 1000,
                        easing: "easeOutBounce",
                        visible: 7
                    });                              
            }, 5000);
  });
    });
    </script>

我的问题是当我点击page1,page2,page3来改变哪个div元素将绑定到jcarousellite但它不起作用。 我希望你帮助我。谢谢!!

我忘了说这是我使用的插件:http://www.gmarwaha.com/jquery/jcarousellite/

1 个答案:

答案 0 :(得分:0)

该插件不适用于多个实例一页。但你可以尝试隐藏其他像这样的: http://jsfiddle.net/kannix/B2PfG/1/