192、箭头控制横向滚动图片

192、箭头控制横向滚动图片

1

把如下代码复制到<head></head>之间

 

<SCRIPT language=JavaScript type=text/JavaScript>

<!--

var sh;

marqueesWidth=610;

preLeft=0; currentLeft=0; stopscroll=false; getlimit=0;preTop=0; currentTop=0;

 

function scrollLeft()

{

       if(stopscroll==true) return;

       preLeft=marquees.scrollLeft;

       marquees.scrollLeft+=2;

       if(preLeft==marquees.scrollLeft)

       {

              //marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;

       }

}

 

function scrollRight()

{

       if(stopscroll==true) return;

 

       preLeft=marquees.scrollLeft;

       marquees.scrollLeft-=2;

       if(preLeft==marquees.scrollLeft)

       {

              if(!getlimit)

              {

                     marquees.scrollLeft=templayer.offsetWidth*2;

                     getlimit=marquees.scrollLeft;

              }

              marquees.scrollLeft-=1;

       }

}

 

function Left()

{

       stopscroll = false;

       sh = setInterval("scrollLeft()",20);

}

 

function Right()

{

       stopscroll = false;

       sh = setInterval("scrollRight()",20);

}

 

function StopScroll()

{

       stopscroll = true;

       clearInterval( sh );

}

 

 

 

function SelectType(value)

{

       document.all.sendForm.page.value = 1;

       document.all.sendForm.type.value = value;

 

       document.all.sendForm.submit();

}

 

function init()

{

       with(marquees)

       {

              style.height=0;

              style.width=marqueesWidth;

              style.overflowX="hidden";

              style.overflowY="visible";

              style.align = "center";

              noWrap=true;

       }

}

 

 

//-->

</SCRIPT>

 

2

把如下代码复制到<body></body>之间

 

<TABLE cellSpacing=1 width=660 align=center border=0>

<TR bgColor=#f8f8f8>

<TD align=middle width=25><IMG

      src="images/

/pointer-left.gif" border=0 onmouseout=StopScroll() onmouseover=Left() style="CURSOR: pointer"></TD>

    <TD>

      <DIV id=marquees>

      <TABLE border=0><TR>

 

<TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/1.jpg' border=0></td></tr><tr><td><div align="center">1</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/2.jpg' border=0></td></tr><tr><td><div align="center">2</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/3.jpg' border=0></td></tr><tr><td><div align="center">1 </div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/4.jpg' border=0></td></tr><tr><td><div align="center">1</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/5.jpg' border=0></td></tr><tr><td><div align="center">2</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/6.jpg' border=0></td></tr><tr><td><div align="center">3</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/7.jpg' border=0></td></tr><tr><td><div align="center">4</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/8.jpg' border=0></td></tr><tr><td><div align="center">5</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/9.jpg' border=0></td></tr><tr><td><div align="center">6</div></td>

</tr></table></TD><TD align=middle width=85><table cellSpacing=0 cellPadding=0 align=center border=0><tr><td><IMG class=imgframe src='images/10.jpg' border=0></td>

</tr><tr><td><div align="center">7</div></td>

</tr></table></TD>     

</TR></TABLE></DIV>

<DIV id=templayer style="LEFT: 0px; VISIBILITY: hidden; POSITION: absolute; TOP: 0px"></DIV></TD>

<TD align=middle width=25><IMG src="images/pointer-right.gif" border=0 onmouseout=StopScroll() onmouseover=Right() style="CURSOR: pointer"></TD>

</TR></TABLE>

 

 

3修改<body>标签为

 

<body onload="init()">

 

Write a comment

Comments: 0