flexslider的WP标签不会播放下一张第二张和第三张幻灯片

时间:2014-03-11 01:27:38

标签: javascript jquery wordpress flexslider

我正在为图库使用flexslider和WP可视化作曲家标签..但是只有播放弹性滑块的第一个/默认标签第二个和第三个标签才会播放弹性滑板......

这是内容和短代码:

[vc_tabs interval="0" el_class="gallery-tabs"][vc_tab title="Models" tab_id="1394091656-1-78"][vc_column_text]

[gallery ids="11686,11685,11684,11683,11682,11681,11680,11679,11678,11677,11676,11675,11674,11673,11672,11671,11670,11669,11668"]

[/vc_column_text][/vc_tab][vc_tab title="Community" tab_id="1394117053869-1-9"][vc_column_text]

[gallery ids="11703,11702,11701,11700,11699,11695,11696,11697,11698"]

[/vc_column_text][/vc_tab][vc_tab title="Events" tab_id="1394117071776-2-2"][vc_column_text]

[gallery ids="11758,11757,11756,11755,11754,11753,11752,11751,11750,11749,11748,11747,11746,11745,11744,11743,11742,11741,11740,11739,11738,11762,11763,11764,11765,11766,11767,11768,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11784,11785,11786,11787,11788,11789,11790,11791,11792"]

[/vc_column_text][/vc_tab]

这是脚本......

jQuery(document).ready(function ($) {
            $(".flexslider").flexslider({animation: "slide",directionNav: false,controlNav: "thumbnails"}); 
            jQuery(".flex-control-nav").jcarousel({vertical: true,scroll:1});
            $(".swipebox").swipebox();
            jQuery('.gallery-tabs ul.ui-tabs-nav li').click(function() {
                $(".flexslider").flexslider({animation: "slide",directionNav: false,controlNav: "thumbnails"}); 
                jQuery(".flex-control-nav").jcarousel({vertical: true,scroll:1});
                $(".swipebox").swipebox();
                console.log("ok");
            });
        });

但是当我尝试在点击功能中添加alert()时,幻灯片会显示,但它会让警报变得烦人。

jQuery(document).ready(function ($) {
            $(".flexslider").flexslider({animation: "slide",directionNav: false,controlNav: "thumbnails"}); 
            jQuery(".flex-control-nav").jcarousel({vertical: true,scroll:1});
            $(".swipebox").swipebox();
            jQuery('.gallery-tabs ul.ui-tabs-nav li').click(function() {
                $(".flexslider").flexslider({animation: "slide",directionNav: false,controlNav: "thumbnails"}); 
                jQuery(".flex-control-nav").jcarousel({vertical: true,scroll:1});
                $(".swipebox").swipebox();
                alert("test");
            });
        });

有没有人对此有所了解?提前谢谢....

1 个答案:

答案 0 :(得分:0)

隐藏在负载上的DOM元素内的Flexsliders和其他插件不会被初始化,通常是因为它无法正确计算尺寸。当选择其选项卡时,您需要使用选项卡插件的回调机制来初始化每个Flexslider。