图片上下左右滚动实例
2007-07-30 11:15
405 查看
向上滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo1>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo2>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="javascript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(demo2.offsetTop-demo.scrollTop<=0)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop-=demo1.offsetHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向下滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo1>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo2>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script>...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop=demo.scrollHeight
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo1.offsetTop-demo.scrollTop>=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop+=demo2.offsetHeight
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop--
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向右滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:670px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="0" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo1" valign="top" align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="2" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo2" valign="top"></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script>...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo.scrollLeft<=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft+=demo2.offsetWidth
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft--
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向左滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:670px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="0" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo1" valign="top" align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="2" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo2" valign="top"></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="javascript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo2.offsetWidth-demo.scrollLeft<=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft-=demo1.offsetWidth
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft++
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
marquees方法向上滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="marquees" style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="JavaScript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marqueesHeight=200;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
stopscroll=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
with(marquees)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.width=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.height=marqueesHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.overflowX="visible";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.overflowY="hidden";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
noWrap=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
onmouseover=new Function("stopscroll=true");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
onmouseout=new Function("stopscroll=false");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
preTop=0; currentTop=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function init()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
templayer.innerHTML="";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
while(templayer.offsetHeight<marqueesHeight)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
templayer.innerHTML+=marquees.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setInterval("scrollUp()",10);//越大越慢
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
document.body.onload=init;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function scrollUp()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(stopscroll==true) return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
preTop=marquees.scrollTop;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop+=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(preTop==marquees.scrollTop)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop+=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo1>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo2>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="javascript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(demo2.offsetTop-demo.scrollTop<=0)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop-=demo1.offsetHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop++;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)};
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向下滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo1>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo2>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script>...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop=demo.scrollHeight
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo1.offsetTop-demo.scrollTop>=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop+=demo2.offsetHeight
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollTop--
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向右滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:670px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="0" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo1" valign="top" align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="2" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo2" valign="top"></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script>...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo.scrollLeft<=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft+=demo2.offsetWidth
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft--
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
向左滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id=demo style="background: #ffffff; overflow: hidden; width:670px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="0" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo1" valign="top" align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table cellpadding="2" cellspacing="0" border="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<tr align="center">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td><img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 /></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<td id="demo2" valign="top"></td>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</tr>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="javascript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var speed=1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo2.innerHTML=demo1.innerHTML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Marquee()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(demo2.offsetWidth-demo.scrollLeft<=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft-=demo1.offsetWidth
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
demo.scrollLeft++
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var MyMar=setInterval(Marquee,speed)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseover=function() ...{clearInterval(MyMar)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
marquees方法向上滚动图片
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="marquees" style="background: #ffffff; overflow: hidden; width:400px; color: #0000ff; height: 500px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img0" height=500px alt="" src="http://photo8.yupoo.com/20070730/110558_1774342009_clqycalf.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img1" height=500px alt="" src="http://photo8.yupoo.com/20070730/110537_739931759_gxvvqlxy.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img2" height=500px alt="" src="http://photo6.yupoo.com/20070730/110537_666202854_mpbiqknx.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img3" height=500px alt="" src="http://photo6.yupoo.com/20070730/110536_205022051_orocyrqg.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img4" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1653741312_foruuosr.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<img id="img5" height=500px alt="" src="http://photo8.yupoo.com/20070730/110535_1428097478_yuniakfi.jpg" width=375px border=0 />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="JavaScript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marqueesHeight=200;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
stopscroll=false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
with(marquees)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.width=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.height=marqueesHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.overflowX="visible";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
style.overflowY="hidden";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
noWrap=true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
onmouseover=new Function("stopscroll=true");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
onmouseout=new Function("stopscroll=false");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
preTop=0; currentTop=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function init()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
templayer.innerHTML="";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
while(templayer.offsetHeight<marqueesHeight)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
templayer.innerHTML+=marquees.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setInterval("scrollUp()",10);//越大越慢
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
document.body.onload=init;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function scrollUp()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(stopscroll==true) return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
preTop=marquees.scrollTop;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop+=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if(preTop==marquees.scrollTop)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
marquees.scrollTop+=1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
相关文章推荐
- jquery图片无缝滚动代码左右上下无缝滚动图片
- 上下左右连续滚动图片的JS代码
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- Android_RecyclerView实现上下滚动广告条实例(带图片)
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- 常用JS图片滚动(无缝、平滑、上下左右滚动)
- js扩展滚动窗口小插件实现文字左右上下滚动效果实例
- 兼容IE6,IE7,IE8,friefox的图片上下左右滚动效果
- 上下左右无空隙不间断图片连续滚动代码
- 图片上下左右的无缝滚动的实现
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- javascript实现文字图片上下滚动的具体实例
- jquery控制左右箭头滚动图片列表的实例
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- 上下左右无空隙不间断图片连续滚动代码
- JS图片滚动(无缝、平滑、上下左右滚动)效果
- msclass实例 jquery 通用滚动特效,文字单行,多行停留滚动,图文上下左右滚动