标题:新闻标题滚动已实现,但左边没对齐,高手指点下,不胜感激!!!
只看楼主
kyle_mao
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-2-2
结帖率:100%
 问题点数:0 回复次数:3 
新闻标题滚动已实现,但左边没对齐,高手指点下,不胜感激!!!
源码:

<style>  
<!--  
#ScrollBox{width:320px;height:120px;font-size:14px;line-height:20px;overflow:hidden;border:0px solid #ccc}  
#ScrollBox ul{margin:0;padding:0;list-style:none}
-->  
</style>  


  <%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function%>



 
 <div id="ScrollBox">
    <ul id="ScrollHolder">
<table width="95%" border="0" cellspacing="0" cellpadding="0">

  <tr>
 
    <td>
   
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
     
              <tr>
                <td width="100%"><table width="100%" border="0" cellspacing="0"    cellpadding="0">
               
                <tr>
                      <td colspan="2">
                        <%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 5 * from news where BigClassName='行业科技' order by AddDate desc "
rs_news.open sqltext4,conn,1,1
                     
%>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        
                          <%i=0
do while not rs_news.eof
strr=year(rs_news("AddDate"))&"-"&month(rs_news("AddDate"))&"-"&day(rs_news("AddDate"))%>
                          <tr  align="center">
                            <td width="28" align="left" style='BORDER-bottom: #C2C2C2 1px dashed'><img src="images/newdot.jpg" width="4" height="7" /></td>
    <td style='BORDER-bottom: #C2C2C2 1px dashed' width="747" height="25" align="left" ><a class="txt" href="shownew.asp?id=<%=rs_news("id")%>&title=媒体报道" target="_blank">
                            <%=cutstr(rs_news("title"),15)%></a>                            </td>
                        <td style='BORDER-bottom: #C2C2C2 1px dashed' width="224" align="right" ><a class="txt" href="shownew.asp?id=<%=rs_news("id")%>&title=媒体报道媒体报道" target="_blank">[<%=strr%>]</a></td>
                          </tr>
                          <%rs_news.movenext
i=i+1
loop
rs_news.close %>
                        </table></td>
                     
                  </tr>
                  
                  </table>
                </td>
              </tr>
    </table>
    </td>
  </tr>
</table>
</ul>
</div>
<script type="text/javascript">
var marquee = {
    init:function(speed){
        this.ScrollBox = document.getElementById("ScrollBox");
        this.ScrollHolder = document.getElementById("ScrollHolder");
        this.speed = speed;
        this.pause = false;
        this.clientH = this.ScrollBox.clientHeight;
        this.ScrollBox.onmouseover = function(){marquee.pause = true;};  
        this.ScrollBox.onmouseout = function(){marquee.pause = false;};  
        this.ScrollHolder.innerHTML += this.ScrollHolder.innerHTML;
        setInterval(this.scrolling,this.speed);
    },
    scrolling:function(){
        if(marquee.pause) return;
        marquee.ScrollBox.scrollTop += 1;
        if(marquee.ScrollBox.scrollTop >= marquee.ScrollHolder.offsetHeight/2){
            marquee.ScrollBox.scrollTop = 0;
        }
    }
}
marquee.init(30);
</script>  

显示如下图:




   
搜索更多相关主题的帖子: function 不胜感激 border 
2012-02-20 11:49
kyle_mao
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-2-2
得分:0 
哪位高手指点下,等着急用,无法用言语表达谢意!!! 
2012-02-20 11:54
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
得分:0 
最好传上全部代码。这样好测试

QQ:63572063
2012-02-21 17:38
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
这个明显CSS设置问题
2012-02-21 18:41



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




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

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