在JSP里,图片可以横向不间断连续滚动,并图片实现超链接。
根据网上介绍代码,在HTML运行可以将图片横向不间断连续滚动,并实现图片超链接,但在JSP里,图片可以横向不间断连续滚动,但图片无法超链接。
请高手指导。
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 无标题文档 </title>
</head>
<body>
<DIV id=demo style= "BACKGROUND: #ffffff; OVERFLOW: hidden; WIDTH: 700px; COLOR: #ffffff; HEIGHT: 100px ">
<TABLE cellPadding=0 align=left border=0 cellspace= "0 ">
<TBODY>
<TR>
<TD id=demo1 vAlign=top> <A href= "d:\web_pic1.jpg " target=_blank> <IMG height=100 src= "d:\web_pic\1.jpg " border=0> </A>
<A href= "d:\web_pic\2.jpg " target=_blank> <IMG height=100 src= "d:\web_pic\2.jpg " border=0> </A>
<A href= "d:\web_pic\3.jpg " target=_blank> <IMG height=100 src= "d:\web_pic\3.jpg " border=0> </A>
<A href= "d:\web_pic\4.jpg " target=_blank> <IMG height=100 src= "d:\web_pic\4.jpg " border=0> </A>
<A href= "d:\web_pic\5.jpg " target=_blank> <IMG height=100 src= "d:\web_pic\5.jpg " border=0> </A>
</TD>
<TD id=demo2 vAlign=top> </TD> </TR> </TBODY> </TABLE> </DIV>
<SCRIPT>
var speed=20
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft <=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</SCRIPT>
</body>
</html>
------解决方案--------------------绝对路径改成相对路径