ITPub博客

首页 > IT职业 > IT图书 > jquery图片轮播

jquery图片轮播

IT图书 作者:regatta 时间:2021-09-09 09:52:31 0 删除 编辑

 效果图:




html>    jquery switchable图片轮播    
");         //展示第一张图片         content.prependTo($(self)).find('img').attr('src',firstImg.attr('imgsrc'));          show(curIndex);         fn = setInterval(show,4000);         a.bind('click',function(){             curIndex = a.index($(this));             show();         });         a.bind({             'mouseenter':function(){                 clearInterval(fn);              },'mouseleave':function(){                  fn = setInterval(show,4000);              }         });                  function show(){             cur = $('ul li a',self).eq(curIndex);             var src = cur.attr('imgsrc');             cur.addClass('cur').parent().siblings().find('a').removeClass('cur');             content.find('img').attr('src',src).css({width:'0px',height:'0px',left:'280px',top:'130px'}).animate({width:'560px',height:'260px',left:'0px',top:'0px'},300,function(){              });             curIndex == len-1? curIndex=0:curIndex++;         };     }; })(jQuery);    
     
             
  •          
  •          
  • item3
  •          
  • item4
  •          
  • item5
  •          
  • item6
  •          
  • item7
  •          
  • item8
  •      
 
   

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2281/viewspace-2813873/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 拖拽RecyclerViewDemo
请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    0
  • 访问量
    578