- <script type='text/javascript'>
- $(function() {
- //滚动的图片
- var $mleft = 0;
- var tf=true;
- setInterval(function(){
- if (tf) {
- $('.showbox').animate({left:$mleft}, 298);
- $mleft-=10;
- if($mleft <= -520) tf=false;
- }else {
- $('.showbox').animate({left:$mleft}, 298);
- $mleft+=10;
- if($mleft >= 0) tf=true;
- }
- },300);
- });
- </script>
- <style type='text/CSS'>
- /*滚动图片*/
- .ibox{width:600px;height:135px;position:relative; overflow:hidden;_top:-20px;background:url(__PUBLIC__/Images/new.png) no-repeat;border:#fff 2px solid;background-position:right 10px;border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px;padding-right:34px;}
- .ibox .showbox{position:absolute;left:0;width:1280px; height:135px;_top:32px;}
- </style>
- <!-- new 滚动图片 -->
- <div class='ibox'>
- <div class='showbox'>
- <ul id='imgs_show2' style='border:none;'>
- <li><img src1='1.jpg'/></li>
- <li><img src1='1.jpg'/></li>
- <li><img src1='1.jpg'/></li>
- <li><img src1='1.jpg'/></li>
- <li><img src1='1.jpg'/></li>
- </ul>
- </div>
- </div>
- //该片段来自于http://www.codesnippet.cn/detail/100120131499.html
来源: http://www.codesnippet.cn/detail/100120131499.html