标题:JS左右滚动问题怎么设置自动适应UL里面来滚动
只看楼主
wubenbenzhu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-4-21
 问题点数:0 回复次数:0 
JS左右滚动问题怎么设置自动适应UL里面来滚动
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.marquee12 {width:903px;height:16px;overflow:hidden; line-height:16px; float:right;}
.marquee12 ul li {float:left; padding:0 15px; line-height:16px;}
</style>
<!--即时消息-->
<table width="980" border="0" cellspacing="0" cellpadding="0">
<tr><td class="news_menu_bottom" style="padding-left:8px;color:#000; font-weight:bold;"> 即时新闻:</td>
<td class="news_menu_bottom">

<div id="marquees" class="marquee12" onmouseover="stop()" onmouseout="start()">
            <table  border="0" cellspacing="0" cellpadding="0" id="scrollimg" >
                <tr>
                    <td id="simga" >
                        
                           <div style="width:4500px; height:16px; border:0; " >

                                   <ul><li style="padding-left:20px;">[珠海] 04-21 09:02<a href="http://bbs.  target="_blank"  style="color:#990000;">♦ 契爷岭巴士站旁海边惊现男尸 环卫工发现后报警</a></li>
<li style="padding-left:20px;">[娱乐] 04-21 09:02<a href="http://info.  target="_blank"  style="color:#990000;">♦ 传熊黛林被查出脑瘤 男友郭富城急寻名医</a></li>
<li style="padding-left:20px;">[国际] 04-21 08:59<a href="http://info.  target="_blank"  style="color:#990000;">♦ 韩学者称韩国人祖先发明汉字 表示中国学界承认</a></li>
<li style="padding-left:20px;">[娱乐] 04-21 08:51<a href="http://info.  target="_blank"  style="color:#990000;">♦ 国王杯决赛-10人皇马1-0巴萨 C罗加时送绝杀</a></li>

</ul>                               </div>
                       
                    </td>
                    <td id="simga1">
                    </td>
                </tr>
            </table>
            </div>
</td></tr>
</table>
            <script language="JavaScript">
            var tm = null
            var scrollimg=document.getElementById("scrollimg");
            var simga1=document.getElementById("simga1");
            var simg=document.getElementById("simga");
            function newsScroll() {
           
                if (scrollimg.parentNode.scrollLeft != (scrollimg.clientWidth / 2))
                    scrollimg.parentNode.scrollLeft++;
                else
                    scrollimg.parentNode.scrollLeft = 0
            }
            window.onload = function() {
            
                simga1.innerHTML = simg.innerHTML
            
                tm = setInterval('newsScroll()', 20)
            }
            function stop() {
                clearInterval(tm)
            }

            function start() {
                tm = setInterval('newsScroll()', 20)
            }
            </script>

        </div>
搜索更多相关主题的帖子: content style 新闻 
2011-04-21 10:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-337413-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039574 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved