开发者

automatic thumbnail slider using jquery : cannot add animation effects

i am trying to make an automatic image slider using jquery. i'm using an unordered list as the source of images. i used the basi开发者_StackOverflow中文版c logic that after a certain delay each

  • would be detached from the list and so on. this is happening but its not happening smoothly.. i tried using animate function but that didnt work either . i even added the easing option in the animate function and still it didnt work. can anyone help me ? thanx in advance

    here is my code function rotate_images() { var i=1;

    var _rotate = function() {

    setTimeout(function() {

    var li=$('#li'+i); $('#li'+i).animate({'display':'none'},1000,'swing',function(){$(this).remove();});

     if(i<5)
     {
      i++;
     _rotate();           
     }
     else
     {
      i=1;
      _rotate();
     }
     },2000);     
    

    }; _rotate(); }


    I highly recommend the jquery cycle plugin to accomplish this:

    http://jquery.malsup.com/cycle/

    Just tell it the parent object and you can customize how it works and use easing effects etc..

  • 0

    上一篇:

    下一篇:

    精彩评论

    暂无评论...
    验证码 换一张
    取 消

    最新问答

    问答排行榜