西湖BLOG正在为您加载数据中……www.xhblog.com
博客日历 
<<  < 2008 - >  >>
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
论坛新贴
登陆管理
西湖BLOG正在为您加载数据中……www.xhblog.com
我的栏目 
西湖BLOG正在为您加载数据中……www.xhblog.com
最新日志
西湖BLOG正在为您加载数据中……www.xhblog.com
最新回复 
西湖BLOG正在为您加载数据中……www.xhblog.com
最新留言 
西湖BLOG正在为您加载数据中……www.xhblog.com
博客信息 
西湖BLOG正在为您加载数据中……www.xhblog.com
网海拾贝 
妖精女人

 □ 鼠标控制图片左右滚动
 
 

<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 
 
阅读全文 | 回复(1) | 引用通告 | 编辑

 □ Re:鼠标控制图片左右滚动
 
 

访客028Jan(游客)收藏了

访客028Jan(游客)发表评论于2008-6-22 12:02:00 
 
个人主页 | 引用 | 返回 | 删除 | 回复

发表评论:
西湖BLOG正在为您加载数据中……www.xhblog.com

博客主人:弯弯的忧伤 版权所有:枉凝眉工作室 QQ:47585486  UC:40201979 留言本本 聊天室 电子地图