标题 | 仿淘宝首页上下滚动广告特效 |
内容 | 有网友通过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> 以上就是代码喽! |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。