求js做出淘宝首页图片的切换

JavaScript015

求js做出淘宝首页图片的切换,第1张

<html><head>     <style>    div{        cursor: pointer        font-size:10pt        }             .pb{    width:300px/*单个图片的宽(和显示区域相同)*/    height:300px/*单个图片的高(和显示区域相同)*/    }    #plist{        position:relative        top:-29px        }    #pshow{    width:300px/*显示区域的宽度*/    height:300px/*显示区域的高度*/    overflow: hidden    position:absolute    top:20px    left:20px        }</style><script src="jquery-1.9.1.js" type="text/javascript"></script><script>    var i=1    function pchange(obj){        var imgtop=((0-(obj-1))*300-29)+"px"        $("#plist").animate({        top:imgtop},"slow")  i=obj++  if(i>4){        i=1        }        } function timechange(){    pchange(i)    i++    if(i>4){        i=1        }        setTimeout('timechange()',3000)    }</script></head> <body onload="timechange()"><div id="pshow">    <div style="display:tableposition:relativeleft:150pxtop:260pxz-index:99">    <div style="display:table-cellwidth:25pxheight:20pxbackground:#EEEE00text-align:center" onmouseover="pchange(1)">1</div>    <div style="display:table-cellwidth:10pxheight:20px"></div>    <div style="display:table-cellwidth:25pxheight:20pxbackground:#EEEE00text-align:center" onmouseover="pchange(2)">2</div>    <div style="display:table-cellwidth:10pxheight:20px"></div>    <div style="display:table-cellwidth:25pxheight:20pxbackground:#EEEE00text-align:center" onmouseover="pchange(3)">3</div>    <div style="display:table-cellwidth:10pxheight:20px"></div>    <div style="display:table-cellwidth:25pxheight:20pxbackground:#EEEE00text-align:center" onmouseover="pchange(4)">4</div>    </div>    <div id="plist">        <div class="pb" style="background:green">                         </div>                    <div  class="pb" style="background:red">                         </div>                    <div class="pb" style="background:blue">                         </div>                    <div  class="pb" style="background:yellow">                         </div>        </div>         </div> </body></html>

推荐你用PocketDisk启明网盘,可以将电脑中的图片、视频、音乐、邮件、聊天记录、浏览器收藏夹等数据资料快速便捷的进行安全备份,很方便。比普通网络硬盘好用多了。恢复起来更方便了,只要设好了恢复目录,一个按钮就搞定,超好用. 能外链的哦支持淘宝空间