www.webdeveloper.com
Results 1 to 1 of 1

Thread: HELP! to autoplay or setinterval to YUI carousel

  1. #1
    Join Date
    Nov 2005
    Posts
    18

    HELP! to autoplay or setinterval to YUI carousel

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

    [code]

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

    [code]
    Last edited by arielmedel; 11-10-2009 at 10:34 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles