Why the rolling text code does not rely on the left alignment display?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css1.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Company</title>
<!--#include file=conn.asp-->
<%
set rs3=server.CreateObject("adodb.Recordset")
sql="Select top 8 new_id,new_title from concent order by new_id desc "
rs3.open sql,conn,1,1
%>
<body>
<div class="leftfdh2">
<div class="leftfdh3">The latest news</div>
<div class="leftfdh4">
<table width="104%" border="0">
<tr>
<td>
<div id="demo" style="overflow:hidden; height:180px; width:220px;">
<%do until rs3.EOF%>
<ul id="demo1">
<li><a href='shownews.asp?new_id=<%=rs3.fields("new_id")%>' target="_blank"><%=left(rs3("new_title"),10)%></a>
<%
rs3.MoveNext
%>
</li>
<%loop
rs3.close
conn.close
%>
</ul>
<div id="demo2"></div>
</div>
<div class="leftfdh5"></div>
</td>
</tr>
</table>
<script>
var speed=1000
var demo=document.getElementById("demo");
var demo2=document.getElementById("demo2");
var demo1=document.getElementById("demo1");
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>
</div>
</div>
</body>
</html>


Please God, I did wrong operation? Why not aligned on the left shows

Started by Darnell at November 10, 2016 - 8:42 AM

Loop table do not match

Posted by maker at November 24, 2016 - 8:46 AM

<%do until rs3.EOF%>
<ul id="demo1">
<li><a href='shownews.asp?new_id=<%=rs3.fields("new_id")%>' target="_blank"><%=left(rs3("new_title"),10)%></a>
<%
rs3.MoveNext
%>
</li>
<%loop
rs3.close
conn.close
%>
</ul>

UL tags on don't


<ul id="demo1">
<%do until rs3.EOF%>

Posted by Donahue at December 08, 2016 - 9:37 AM

<div id="demo" style="overflow:hidden; height:180px; width:220px;">
       <%do until rs3.EOF%>
       <ul id="demo1">

Change
<div id="demo" style="overflow:hidden; height:180px; width:220px;">
<ul id="demo1">  
       <%do until rs3.EOF%>

Posted by Jeremiah at December 17, 2016 - 9:39 AM

Style has a problem, try to have a look to add text-align:left style

Posted by Anne at December 25, 2016 - 10:10 AM