温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

类似QQ管家页面jquery图片显隐轮换效果

发布时间:2020-06-29 00:54:26 来源:网络 阅读:226 作者:jqueryba 栏目:web开发

 又得开始新的工作累人啊。

这两天jquery博客有不少感慨,感觉人有时要是言而无信,那不管做什么事情都不会成功的,觉得,既然说出口了,或者,暗暗下决心做了,就一定做成功。如果不行,那是自己的责任。不多说了,做个类似QQ管家页面jquery图片显隐轮换效果,感觉在哪个页面中看到过,反正是腾讯的,故加个类似。http://www.jqueryba.com/475.html
$(document).ready(function() {
  var z = 0;
  var inAnimation = false;
  $('#box img').each(function() {
    z++;
    $(this).css('z-index', z);
  });
  function slide() {
    if(inAnimation) return false;
    else inAnimation = true;
    var MaxZindex = z; SecondZindex = z-1;
    $('#box img').each(function() {
      if($(this).css('z-index') == MaxZindex) {
        $(this).animate({left:"350px"}, 800, function() {
          $(this).css('z-index', 1)
            .animate({left:"0px"}, 800, function() {
              inAnimation = false;
            });
        });
      } else if($(this).css('z-index') == SecondZindex) {
$(this).animate({left:"-80px"}, 800, function() {
          $(this).css('z-index', parseInt($(this).css('z-index')) + 1);
        }).animate({left:"0px"}, 800);
 }else{
        $(this).animate({left:"0px"}, 600, function() {
          $(this).css('z-index', parseInt($(this).css('z-index')) + 1);
        });
      }
    });
    return false;
  }
  $('#box').click(function() {
    slide();
  });
});
在线效果DEMO
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI