部分代码如下:<script language="javascript">
<!--
var speed=30;
document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML;
document.getElementById("demo").scrollLeft=document.getElementById("demo").scrollWidth;
function Marquee(){
if(document.getElementById("demo").scrollLeft<=0)
document.getElementById("demo").scrollLeft+=document.getElementById("demo2").offsetWidth;
else{
document.getElementById("demo").scrollLeft--;
}
}
var MyMar=setInterval(Marquee,speed);
document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)};
document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script><body bgcolor="#84b46a" leftmargin="0" topmargin="0">
<div>
<table width="800" height="500" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="images/inner_bg.jpg">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/inner_bg.jpg">
<table>
<tr>
<td width="251" height="82" align="center"></td>
<td width="537"><img src="images/inner_title.GIF" width="500" height="80"></td>
</tr>
</table>
</td>
</tr>
</table>
<table height="300" border="0" cellpadding="0" cellspacing="0">
</table>
<table align="center" height="100" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<div id="demo" style="overflow:hidden;height:33;width:500;background:#214984;color:#ffffff">
<table align="center" cellpadding="0" cellspace="0" border="0">
<tr>
<td id="demo1" valign="top">
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://www.blueidea.com/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://www.yiiboo.com/cgercn/link.gif">
<img src="images/flash8.gif">
</td>
<td id="demo2" valign="top">
</td>
</tr>
</table>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</div>
但是我运行了以后,只能出现一行静止的图片,图片组无法实现跑马灯效果,但是如果把相应的<div>和JS代码单独考到一个空文件中,就可以正常运行了……不知道是什么问题?请各位高手指教!小弟不胜感激!
<!--
var speed=30;
document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML;
document.getElementById("demo").scrollLeft=document.getElementById("demo").scrollWidth;
function Marquee(){
if(document.getElementById("demo").scrollLeft<=0)
document.getElementById("demo").scrollLeft+=document.getElementById("demo2").offsetWidth;
else{
document.getElementById("demo").scrollLeft--;
}
}
var MyMar=setInterval(Marquee,speed);
document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)};
document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script><body bgcolor="#84b46a" leftmargin="0" topmargin="0">
<div>
<table width="800" height="500" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="images/inner_bg.jpg">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/inner_bg.jpg">
<table>
<tr>
<td width="251" height="82" align="center"></td>
<td width="537"><img src="images/inner_title.GIF" width="500" height="80"></td>
</tr>
</table>
</td>
</tr>
</table>
<table height="300" border="0" cellpadding="0" cellspacing="0">
</table>
<table align="center" height="100" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<div id="demo" style="overflow:hidden;height:33;width:500;background:#214984;color:#ffffff">
<table align="center" cellpadding="0" cellspace="0" border="0">
<tr>
<td id="demo1" valign="top">
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://www.blueidea.com/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://www.yiiboo.com/cgercn/link.gif">
<img src="images/flash8.gif">
</td>
<td id="demo2" valign="top">
</td>
</tr>
</table>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</div>
但是我运行了以后,只能出现一行静止的图片,图片组无法实现跑马灯效果,但是如果把相应的<div>和JS代码单独考到一个空文件中,就可以正常运行了……不知道是什么问题?请各位高手指教!小弟不胜感激!
解决方案 »
- 求高手解决JS问题
- js向PHP传值
- JvavScript中表單Form中的select值如何傳到另一個頁面?Action?
- js中的转义字符问题
- 问fason(阿信)你的树控件什么时候会更新一个版本?
- 请教高手,如何将javascript从数据库中查询到的内容写入 select list中
- 请教:从数据集得到动态数据的滚动公告板如何实现?
- 紧急求救呀,onload情况下实现设置并自动打印??
- 关于编辑器乱码
- swiper 动态加载后台数据到slide中,分页符只有一个pagination怎么解决?
- JavaScript可以操作浏览器的缓冲区吗?
- ie7 下使用window.open()下载问题
<div id="demo" style="overflow:scroll;height:33;width:500;background:#214984;color:#ffffff">
<table align="center" cellpadding="0" cellspace="0" border="1">
<td id="demo1" valign="top" width="501">
<table align="center" cellpadding="0" cellspace="0" border="0" width="500">
<tr>
<td id="demo1" valign="top">
<img src="images/link/flashempire.gif">
<img src="images/linklogo/shlogo.gif">
<img src="images/link/deskcity.gif">
<img src="images/linklogo/5dmeng.gif">
<img src="http://www.blueidea.com/logo.gif">
<img src="images/link/flashskylogo.gif">
<img src="images/link/5dlogo88.gif">
<img src="http://www.yiiboo.com/cgercn/link.gif">
<img src="images/flash8.gif">
</td>
<td id="demo2" valign="top">
</td>
</tr>
</table>
</div>