Scripts 学盟
标题:
JS滚动在XHTML 1.0 Transitional不能用解决方案
[打印本页]
作者:
莺子
时间:
2011-6-15 15:42:42
标题:
JS滚动在XHTML 1.0 Transitional不能用解决方案
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>QQ在线客服代码</title>
</head>
<body>
<form id="form1" runat="server">
<div id="gundongxinxi" style="width:260px; height:215px; line-height:18px; overflow: hidden" onmouseover="stop()"
onmouseout="start()">
<table width="260" border="0" cellspacing="0" cellpadding="0" id="scrollimg" height="215">
<tr>
<td id="simg">
<table width="260" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75" height="30" bgcolor="#FF9900">黄骅市</td>
<td width="80" bgcolor="#FF9900">线路A</td>
<td width="105" bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">李三</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">赵小六</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">姚岑</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">成之龙</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">六小龄童</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">华佗</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">刘德华</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td width="75" height="30" bgcolor="#FF9900">黄骅市</td>
<td width="80" bgcolor="#FF9900">线路A</td>
<td width="105" bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">李三</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">赵小六</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">姚岑</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">成之龙</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">六小龄童</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
<tr>
<td height="30" bgcolor="#FF9900">华佗</td>
<td bgcolor="#FF9900">线路A</td>
<td bgcolor="#FF9900">2011-05-07</td>
</tr>
<tr>
<td height="30">刘德华</td>
<td>线路A</td>
<td>2011-05-07</td>
</tr>
</table>
</td>
<td id="simg1">
</td>
</tr>
</table>
<script language="JavaScript">
var tm = null
var scrollimg=document.getElementById("scrollimg");
var simg1=document.getElementById("simg1");
var simg=document.getElementById("simg");
function newsScroll() {
if (scrollimg.parentNode.scrollTop != (scrollimg.clientHight / 2))
scrollimg.parentNode.scrollTop++;
else
scrollimg.parentNode.scrollTop = 0
}
window.onload = function() {
simg1.innerHTML = simg.innerHTML
tm = setInterval('newsScroll()', 20)
}
function stop() {
clearInterval(tm)
}
function start() {
tm = setInterval('newsScroll()', 20)
}
</script>
</div>
</form>
</body>
</html>
在<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">页面下不能滚动
作者:
丫丫
时间:
2011-6-15 15:50:50
俺不会,友情帮顶
作者:
那个谁
时间:
2011-6-15 15:52:13
俺不会,友情帮顶
作者:
莺子
时间:
2011-6-15 15:56:06
你们是蹭分的吧
作者:
混混@普宁.中国
时间:
2011-6-15 16:07:56
scrollimg.clientHight
--->
scrollimg.clientHeight
欢迎光临 Scripts 学盟 (http://www.iscripts.org/)
Powered by Discuz! X2