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

本文介绍了一个使用jQuery实现的图片轮播效果,通过调整元素的层级和位置实现了平滑过渡。作者强调了言出必行的重要性,并分享了一个类似QQ管家页面的图片显隐轮换效果的代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一晃 端午节又过去了,又得开始新的工作累人啊。

这两天jquery博客有不少感慨,感觉人有时要是言而无信,那不管做什么事情都不会成功的,觉得,既然说出口了,或者,暗暗下决心做了,就一定做成功。如果不行,那是自己的责任。不多说了,做个类似QQ管家页面jquery图片显隐轮换效果,感觉在哪个页面中看到过,反正是腾讯的,故加个类似。

    $(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


http://www.jqueryba.com/475.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值