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

请输入您要查询的范文:

 

标题 仿淘宝首页上下滚动广告特效
范文
    有网友通过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/29 23:21:41