图片横向滚动

<style type="text/css">
    <!--
    #demo {
 background: #FFF;
 overflow:hidden;
 border: none;
 width: 965px;
 height: 160px;
    }
    #demo img {
 
    }
    #indemo {
     float: left;
     width: 800%;
    }
    #demo1 {
     float: left;
    }
    #demo2 {
     float: left;
    }
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
}
.move_list_cell{height:160px; float:left; width:180px; text-align:center;}
.move_list_img{}
.move_list_pic{height:122px; border:1px solid #ccc; padding:2px;}
.move_list_title{ font-size:12px; margin-top:5px;}
    -->
    </style>
 
    <div id="demo">
    <div id="indemo" style="margin-top:10px;">
    <div id="demo1">
       <%
   SortSql="Select * From product"
 Set SortRs= Server.CreateObject("ADODB.Recordset")
 SortRs.Open SortSql,Conn,1,1
 
do while not SortRs.EOF %>
 <div class="move_list_cell"><div class="move_list_img"><a href="Customer_Show.asp?ItemID=65" target="_blank"><img src="<%=SortRs("product_pic")%>" class="move_list_pic"/></a></div><div class="move_list_title"><%=SortRs("product_name")%></div></div>
    <%
  SortRs.MoveNext
 Loop

 SortRs.Close
 Set SortRs=Nothing
%>
    </div>
    <div id="demo2"></div>
    </div>
    </div>
    <script>
    <!--
    var speed=30; //数字越大速度越慢
    var tab=document.getElementById("demo");
    var tab1=document.getElementById("demo1");
    var tab2=document.getElementById("demo2");
    tab2.innerHTML=tab1.innerHTML;
    function Marquee(){
    if(tab2.offsetWidth-tab.scrollLeft<=0)
    tab.scrollLeft-=tab1.offsetWidth
    else{
    tab.scrollLeft++;
    }
    }
    var MyMar=setInterval(Marquee,speed);
    tab.οnmοuseοver=function() {clearInterval(MyMar)};
    tab.οnmοuseοut=function() {MyMar=setInterval(Marquee,speed)};
    -->
    </script>

转载于:https://www.cnblogs.com/xgcblog/archive/2011/05/19/2050747.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值