`
jsntghf
  • 浏览: 2476621 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

滚动字幕效果

阅读更多
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>  
    <head>  
        <style type="text/css">  
            #newslist{  
                background:#f7f7f7;border:1px solid silver;padding:1px;height:20px;line-height:20px;width:300px;  
            }  

            #contain{  
                font-size:12px;overflow:hidden;list-style:none;width:300px;height:20px;margin:0px;padding:0;  
            }  

            #contain li{  
                height:20px;line-height:20px;white-space:nowrap;overflow:hidden;  
            }  
        </style>  
    </head>  
    <body>  
        <div id="newslist">  
            <ul id="contain">  
                <li><a href="">A</a></li>  
                <li><a href="">B</a></li>  
                <li><a href="">C</a></li>  
                <li><a href="">D</a></li>  
            </ul>  
        </div>  
        <script type="text/javascript">  
            function fun(){  
                var container = document.getElementById("contain");  
                container.appendChild(container.firstChild);  
            }  

            setInterval("fun()", 3000);  
        </script>  
    </body>  
</html> 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics