我可以让Jquery slideViewer自动播放吗?

时间:2009-06-17 20:16:53

标签: jquery

关于制作slideViewr插件的想法(2007-2009 Gian Carlo Mingati |交互式媒体的设计和开发)自动播放?

我尝试升级到slideViewerPro,但不喜欢缩略图和其他内容。

感谢。

3 个答案:

答案 0 :(得分:2)

以上在Internet Explorer中不起作用。相反,我建议将其调整为:

<script type="text/javascript">
var theLinks;
var nCount = 0;
var theTimerID;

function init(){
    $("div#mygalone").slideView();
    theLinks = jQuery('#stripTransmitter0 a');

        //for kill interval purposes
        theTimerID = setInterval("autoSlide()", 5000);
}
function autoSlide(){
    jQuery.each(theLinks, function(i){
        if(jQuery(this).hasClass('current')){
            jQuery(theLinks[((i+1 < theLinks.length) ? (i+1) : 0)] ).trigger("click");
            return false;
        }
    });
}

$(window).bind("load", init );
</script>

答案 1 :(得分:1)

我看到它的方式你基本上有3个选项:

(1) - 使用slideViewPro,但使用thumbsVis:false选项禁用缩略图,如下所示

$("div#noui").slideViewerPro({ 
    galBorderWidth: 0, 
    autoslide: true,  
    thumbsVis: false, 
    shuffle: true 
 });

(2) - 转而使用 jQuery cycle plug-in

(3) - 编辑原始slideViewer的源代码,并使用计时器添加您自己的autoslide实现,并在导航上触发点击事件。

如果我在你的鞋子里,我会坚持选择1。

答案 2 :(得分:0)

Here´s my implementation:

var theLinks;
var nCount = 0;
var theTimerID;

function init(){
    $("div#mygalone").slideView();
    theLinks = jQuery('#stripTransmitter0 a');

        //for kill interval purposes
        theTimerID = setInterval("autoSlide()", 8000);
}
function autoSlide(){
    nCount++;
    if(nCount == theLinks.length ) nCount = 0;
    console.log(theLinks);
    jQuery(theLinks[nCount]).trigger("click");
}

$(window).bind("load", init );