I want this carousel slideshow to also start automatically if idle after a few secs... I tried adding a set interval but with no success so far, please help!!!
YAHOO.example = function() {
var $D = YAHOO.util.Dom;
var $E = YAHOO.util.Event;
var $A = YAHOO.util.Anim;
var $M = YAHOO.util.Motion;
var $DD = YAHOO.util.DD;
var $ = $D.get;
var mova = 1;
return {
init : function() {
$E.on(['move-left','move-right','videos','podcasts','webinars'], 'click', this.move);
},
move : function(e) {
$E.stopEvent(e);
switch(this.id) {
case 'move-left':
if ( mova === 1 ) {
return;
}
var attributes = {
points : {
by : [500, 0]
}
};
mova--;
break;
case 'move-right':
if ( mova === 3 ) {
return;
}
var attributes = {
points : {
by : [-500, 0]
}
};
mova++;
break;
case 'videos':
mova = 1;
ajaxLoader('/xmlfiles/videos.xml','slide');
break;
case 'podcasts':
mova = 1;
ajaxLoader('/xmlfiles/podcasts.xml','slide');
break;
case 'whitepapers':
mova = 1;
ajaxLoader('/xmlfiles/css/whitepapers.xml','slide');
break;
case 'webinars':
mova = 1;
ajaxLoader('/xmlfiles/webinars.xml','slide');
break;
};
var anim = new $M('themes', attributes, 0.5, YAHOO.util.Easing.easeOut);
anim.animate();
}
};
}();
YAHOO.util.Event.onAvailable('doc',YAHOO.example.init, YAHOO.example, true);