| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 311 人关注过本帖
标题:[求助]代码问题
只看楼主 加入收藏
wxyh01
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-12-4
结帖率:40%
收藏
 问题点数:0 回复次数:1 
[求助]代码问题
帮忙解释一下这段代码,另请给改一下这个代码能不能改成向左滚动显示图片
<script language=JavaScript1.2>

var marqueewidth=150
var marqueeheight=170
//设置marquee的速度
var speed=1
//设置marquee的显示内容
var marqueecontents='<font font-size:9pt><%rs.open "select * from ggl order by addtime desc",conn,1,1
if rs.recordcount<1 then
response.Write(".暂时没有公告信息!")
else
do while not rs.eof
if rs("content")<>"" then
response.Write(".<a href=ggl_browse.asp?id="&rs("id")&" target=_blank>"&rs("title")&"</a><br><br>")
else
response.Write(".<a href="&rs("filepath")&" target=_blank>"&rs("title")&"</a><br><br>")
end if
rs.movenext
loop
end if
rs.close%><br></font>'

if (document.all)
document.write('<marquee onmouseover=this.stop() onmouseout=this.start() direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')


function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}


</script>
搜索更多相关主题的帖子: 代码 
2007-01-11 10:54
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
这是让信息滚动的代码,这是最概括的解释.
让图片向左滚动只要改一个地方就行了.
只要把下面代码中的up改成left就行了.
既将下面的代码改成
if (document.all)
document.write('<marquee onmouseover=this.stop() onmouseout=this.start() direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')

改成
if (document.all)
document.write('<marquee onmouseover=this.stop() onmouseout=this.start() direction="left" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')
此代码我没验证,自己验证一下,应该没错.
2007-01-11 11:46
快速回复:[求助]代码问题
数据加载中...
 
   



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

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