couchua
couchua

Reputation: 65

Can I make the Jquery slideViewer autoplay?

Any thoughts on making the slideViewr plugin from (2007-2009 Gian Carlo Mingati | design and development for interactive media) autoplay?

I tried upgrading to the slideViewerPro, but did not like the thumbnails and other stuff.

Thanks.

Upvotes: 0

Views: 3287

Answers (3)

JKgraphiks
JKgraphiks

Reputation: 21

The above doesn't work in Internet Explorer. Instead I recommend tweaking it to:

<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>

Upvotes: 2

sminutoli
sminutoli

Reputation: 1

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 );

Upvotes: 0

Jose Basilio
Jose Basilio

Reputation: 51468

The way I see it you basically have 3 options here:

(1) - Use slideViewPro, but disable thumbnails using the thumbsVis:false option as shown below

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

(2) - Switch to using the jQuery cycle plug-in instead

(3) - Edit the source code of original slideViewer and add your own autoslide implementation by using timers and firing the click event on the navigation.

If I were in your shoes, I would stick with option 1.

Upvotes: 1

Related Questions