乌龙球

It is a long road.

« Chrome+google的完美搭配使用技巧--Chrome可当计算器郑州金典标识设计制作有限公司首页效果图(已经上线)--Fireworks »

无间隙左滚动、右滚动源码

<table width="670" border="0" align="center" cellpadding="0" cellspacing="3">
    <tbody>
        <tr>
            <td>
            <div id="demo" style="overflow: hidden; width: 670px; height: 230px">
            <table cellpadding="0" align="left" border="0" cellspace="0" width="670">
                <tbody>
                    <tr>
                        <td id="demo1" valign="top">
                        <table cellspacing="0" cellpadding="0" width="670" border="0">
                            <tbody>
                                <tr align="center">
                                    <td width="120">
                                    <table width="120" border="0" cellspacing="5" cellpadding="0">
                                        <tbody>
                                            <tr>
                                                <td>图片</td>
                                            </tr>
                                            <tr>
                                                <td>文字</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                        <td id="demo2" valign="top"> </td>
                    </tr>
                </tbody>
            </table>
            </div>
            <div id="demo0" style="overflow: hidden; width:670px; height: 230px">
            <table cellpadding="0" align="left" border="0" cellspace="0" width="670">
                <tbody>
                    <tr>
                        <td id="demo11" valign="top">
                        <table cellspacing="0" cellpadding="0" width="670" border="0">
                            <tbody>
                                <tr align="center">
                                    <td width="120">
                                    <table width="120" border="0" cellspacing="5" cellpadding="0">
                                        <tbody>
                                            <tr>
                                                <td>图片</td>
                                            </tr>
                                            <tr>
                                                <td>文字</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                        <td id="demo22" valign="top"> </td>
                    </tr>
                </tbody>
            </table>
            </div>
            <script type="text/javascript" language="JavaScript">//调用向左滚动toleft("demo","demo1","demo2",30,"hehe123")//调用向右滚动toright("demo0","demo11","demo22",20,"hehe1123")function $(id){return document.getElementById(id)}//向左滚动函数,demo包含demo1与demo2,speed是滚动速度,flag一个网页内有多个时设置为不同的任意字符。function toleft(demo,demo1,demo2,speed,flag){demo=$(demo);demo1=$(demo1);demo2=$(demo2)demo2.innerHTML=demo1.innerHTMLfunction Marquee(){if(demo2.offsetWidth-demo.scrollLeft<=0){demo.scrollLeft-=demo1.offsetWidth}else{demo.scrollLeft++}}flag=setInterval(Marquee,speed)demo.onmouseover=function(){clearInterval(flag);}demo.onmouseout=function(){flag=setInterval(Marquee,speed);}}//向右滚动函数,demo包含demo1与demo2,speed是滚动速度,flag一个网页内有多个时设置为不同的任意字符。function toright(demo,demo1,demo2,speed,flag){demo=$(demo);demo1=$(demo1);demo2=$(demo2)demo2.innerHTML=demo1.innerHTMLfunction Marquee(){if(demo.scrollLeft<=0){demo.scrollLeft=demo2.offsetWidth}else{demo.scrollLeft--}}flag=setInterval(Marquee,speed)demo.onmouseover=function(){clearInterval(flag);}demo.onmouseout=function(){flag=setInterval(Marquee,speed);}}</script></td>
        </tr>
    </tbody>
</table>

  • 相关文章:

日历

联系乌龙球

    评论留言已关闭
    OwnGoalCn@gmail.com

最近发表

Powered By Z-Blog 1.8 Arwen Build 81206 Code detection by Codefense

Copyright www.wulongqiu.org 2009