js简单实现tab滚动方法
方法:主要通过js控制tab所属容器的 scrollLeft 属性值变动即可,连续效果通过 setInterval(function,speed) 方法来控制移动速度<HTML >
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type CONTENT="text/html; charset=gb2312">
<LINK HREF="<%=request.getContextPath() %>/Css/default.css" type=text/css rel=stylesheet>
<LINK HREF="<%=request.getContextPath() %>/Css/style.css" TYPE="text/css" rel=stylesheet>
<LINK HREF="<%=request.getContextPath() %>/Css/tab2011.css" TYPE="text/css" rel=stylesheet>
<script src="<%=request.getContextPath() %>/Js/tab2011.js" type="text/javascript" ></script>
<style>
html{margin:0px;overflow:hidden;}
body{margin:0px;overflow:hidden;}
</style>
</HEAD>
<body>
<table style="width:100%;height:100%;" cellpadding="0" cellspacing="0">
<tr height="25px">
<td width="100%" class="td2">
<div id="demo" style="float:left;margin-bottom:-2px;width:91%;height:25px;overflow:hidden;">
<div id="spans" style="float:left;width:1300px;">
<span class="menu6" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo1">demo1</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo2">demo2</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo3">demo3</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo4">demo4</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo5">demo5</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo6">demo6</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo7">demo7</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo8">demo8</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo9">demo9</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo10">demo10</span>
<span class="menu5" onclick="linkUrlb('http://www.baidu.com','menu6','menu5');" title="demo11">demo11</span>
</div>
</div>
<div style="float:right;margin-bottom:-2px;width:8%;height:25px;overflow:hidden;">
<span title="鼠标在上向右移动,移开鼠标停止" class="menu5" style="padding:2;float:right;cursor:hand;border:thin dotted 1px red;" onmouseover="scrollR();" onmouseout="scrollStop();">
<font color=red><B>→</B></font>
</span>
<span title="鼠标在上向左移动,移开鼠标停止" class="menu5" style="padding:2;float:right;cursor:hand;border:thin dotted 1px red;" onmouseover="scrollL();" onmous