无缝滚动Js

<html>
<body>
    
<div style="width: 190px; height: 127px; overflow: hidden; font-size: 12px;">
    <a class="J_TokenSign" href="http://favorite.taobao.com/popup/add_collection.htm?spm=a1z10.1.0.51.TDVDCm&amp;id=66059960&amp;itemid=66059960&amp;itemtype=0&amp;selle
rid=688629367&amp;scjjc=2&amp;_tb_token_=3eb1b18ea336&amp;scene=taobao_shop" target="_self">
<img height="127" src="http://img02.taobaocdn.com/imgextra/i2/688629367/T26PS0XixbXXXXXXXX_!!688629367.gif" style="margin: 0px; float: none;" width="190" /></a></div>
<div  style="width: 179px; height: 251px; overflow: hidden; font-size: 12px;">    
    <div id=demo style="OVERFLOW: hidden;width: 170px; height: 130px;">
        <div id=demo1>
        <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 欢迎光临本店!<br/>
            &nbsp; 本店新开张,所有商品都是低价销售,不为利润,只求信誉。本店宗旨: 敢和信!</p>
        <p>
            &nbsp;&nbsp;有实体店铺,还有更多商品未上架,有其他需要也可联系。<br />
            &nbsp; 有任何疑问请与客服联系,将为您提供耐心解答!
            <br/>
        </p>
            <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 欢迎光临本店!<br/>
            &nbsp; 本店新开张,所有商品都是低价销售,不为利润,只求信誉。本店宗旨: 敢和信!</p>
        <p>
            &nbsp;&nbsp;有实体店铺,还有更多商品未上架,有其他需要也可联系。<br />
            &nbsp; 有任何疑问请与客服联系,将为您提供耐心解答!
        </p>
        </div>
<div id=demo2>
    </div>
    
</div>
    
    <div style="margin: 15px 10px 0px; width: 169px; height: 41px;">
        <table align="center" border="0" cellpadding="0" cellspacing="0" class="" height="155" width="170">
            <tbody>
                <tr>
                    <td width="68">
                        <div align="left">
                            <font style="color: rgb(0, 0, 0);">客服旺旺</font></div>
                    </td>
                    <td width="102">
                        <div>
                            <a href="http://www.taobao.com/webww/?
spm=a1z10.1.0.56.4HacQb&amp;ver=1&amp;&amp;touid=cntaobao%E5%AE%9E%E4%B9%8B%E4%B8%BA%E8%99%9A&amp;siteid=cntaobao&amp;status=2&amp;portalId=&amp;gid=&amp;itemsId=&amp;scene=taobao_shop" target="_blank"><img height="19" 
src="http://2www.yubaibai.com.cn/cy/wwd.gif" style="margin: 0px; float: none;" 
width="77" /></a></div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left">
                            <font style="color: rgb(0, 0, 0);"></font>&nbsp;联系手机</div>
                    </td>
                    <td>
                        <div>
                            &nbsp;123456789</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div align="left">
                            <font style="color: rgb(0, 0, 0);"></font></div>
                    </td>
                    <td>
                        <div>
                            &nbsp;</div>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <div>
                            &nbsp;</div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br />
                        <br />
                        <br />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<p>
    &nbsp;</p>
<div>
    &nbsp;</div>
        <SCRIPT >
            var speed = 30;
            demo2.innerHTML = demo1.innerHTML;
            function Marquee() {
                if (demo2.offsetTop - demo.scrollTop <= 0)
                    demo.scrollTop -= demo1.offsetHeight;
                else {
                    demo.scrollTop++;
                }
            }
            var MyMar = setInterval(Marquee, speed);
            demo.onmouseover = function () { clearInterval(MyMar); }
            demo.onmouseout = function () { MyMar = setInterval(Marquee, speed); }
    </SCRIPT>
</body>
</html>

 

posted @ 2013-09-28 08:49  南修子  阅读(278)  评论(0编辑  收藏  举报