网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 仿淘宝首页上下滚动广告特效
范文
    有网友通过qq群想做一个淘宝首页的上下翻动的特效。通过火狐的firebug查看是通过层的隐藏和定位来实现的。
    我共用了淘宝的内容,然后通过jquery操作对其进行特效实施。
    查看特效:仿淘宝首页上下滚动广告特效
    代码如下:
    jquery代码
    <script language=javascript>
    <!--
    $(function(){
    var $t=math.floor(math.random()*3); //随机产生一个1-3数字 默认显示第几个
    $(#upc).click(function(){//向上点击
    $t++;if($t>=2){$t=2;$(this).addclass(disable);};
    $(#rollcontent).animate({top:-194*$t});
    $(#downc).removeclass(disable);
    $(#numshow > em).text($t*3+-+($t+1)*3);
    });
    $(#downc).click(function(){//向下点击
    $t--;if($t<=0){$t=0;$(this).addclass(disable);}
    $(#rollcontent).animate({top:-194*$t});
    $(#upc).removeclass(disable);
    $(#numshow>em).text($t*3+1+-+($t+1)*3);
    });
    $(#numshow>em).text($t*3+1+-+($t+1)*3);
    if($t==0)$(#downc).addclass(disable);
    if($t==2)$(#upc).addclass(disable);
    $(#rollcontent).animate({top:-194*$t});
    });
    -->
    </script>
    以上就是代码喽!
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/25 2:59:47