| |
<table width="0" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><!--滚动代码开始 从这里拷贝--> <style> /*图片滚动整体宽度,包括左右控制箭头*/ #picroll{width:410px} /*图片区域高度*/ .rollContent{height:400px;white-space:nowrap;} /*下面的width 也要修改,就是纯图片内容区域的宽度,不包括左右控制箭头*/ #roller{overflow:hidden;width:380px} </style> <script> </script> <br> <script>var rollTimer; function roll(opt){ var roller = document.getElementById("roller"); var rollStep = 10;//单位时间内滚动的距离,可调节速度,越大越快 rollTimer = setInterval(function(){roller.scrollLeft += parseInt(opt)*rollStep;},10);//单位时间,可调节速度,越小越快 } function stopRolling(){ clearInterval(rollTimer); } </script> <!--修改下面这个表格的width和height--> <table id="picroll" height="400" border="0" cellspacing="0" cellpadding="0"> <tr> <!--下面这个td是左边的箭头--> <td width="20" align="center" valign="middle" style="cursor:pointer" onMouseOver="roll(1)" onMouseUp="stopRolling()" onMouseOut="stopRolling()"><img src=" | UploadFiles/2008-5/141343771096.gif"></td>
<td nowrap>
<div id="roller">
<div class="rollContent">
<!--这里放图片内容-->
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<a href="http://wangningmei.xuntan.com/index.php" target="_blank"><img src="UploadFiles/2007-11/51124461776.jpg" width="380" height="400" border="0"></a>
<!--图片内容结束-->
</div>
</div> </td>
<!--下面这个td是右边的箭头-->
<td width="20" align="center" valign="middle" style="cursor:pointer" onMouseOver="roll(-1)" onMouseUp="stopRolling()" onMouseOut="stopRolling()"><img src="UploadFiles/2008-5/141343992306.gif"></td>
</tr>
</table>
<!--滚动代码结束--></td>
</tr>
</table>
演示:
|
弯弯的忧伤 发表于 2008-5-14 13:55:00 |
|