求一段JS 将滑动门“点击切换”改为“鼠标放上去切换”
输入文字限制了不能全部输入JS部分:<script>functionc1it(tabName,btnId,tabNumber){for(i=0;i<tabNumber;i...
输入文字限制了不能全部输入
JS部分:
<script>
function c1it(tabName,btnId,tabNumber){
for(i=0;i<tabNumber;i++){
document.getElementById(tabName+"_div"+i).style.display = "none";
document.getElementById(tabName+"_btn"+i).className = "off";
}
document.getElementById(tabName+"_div"+btnId).style.display = "block";
document.getElementById(tabName+"_btn"+btnId).className = "on";
}
function crazybu(tabName,btnId,tabNumber){
for(i=0;i<tabNumber;i++){
document.getElementById(tabName+"_div"+i).style.display = "none";
document.getElementById(tabName+"_btn"+i).className = "cyaskbu2";
}
document.getElementById(tabName+"_div"+btnId).style.display = "block";
document.getElementById(tabName+"_btn"+btnId).className = "cyaskbu1";
}
</script>
全部内容 可直接运行:
http://bbs.blueidea.com/thread-2950888-1-1.html
演示:http://www.700la.com
能够直接改JS吗 展开
JS部分:
<script>
function c1it(tabName,btnId,tabNumber){
for(i=0;i<tabNumber;i++){
document.getElementById(tabName+"_div"+i).style.display = "none";
document.getElementById(tabName+"_btn"+i).className = "off";
}
document.getElementById(tabName+"_div"+btnId).style.display = "block";
document.getElementById(tabName+"_btn"+btnId).className = "on";
}
function crazybu(tabName,btnId,tabNumber){
for(i=0;i<tabNumber;i++){
document.getElementById(tabName+"_div"+i).style.display = "none";
document.getElementById(tabName+"_btn"+i).className = "cyaskbu2";
}
document.getElementById(tabName+"_div"+btnId).style.display = "block";
document.getElementById(tabName+"_btn"+btnId).className = "cyaskbu1";
}
</script>
全部内容 可直接运行:
http://bbs.blueidea.com/thread-2950888-1-1.html
演示:http://www.700la.com
能够直接改JS吗 展开
1个回答
展开全部
把这个页面的onclick替换成onmouseover就可以了,如下:
<ul>
<li class="on" id="tab4_btn0" onmouseover="c1it('tab4',0,8)">笑 话</li>
<li class="off" id="tab4_btn1" onmouseover="c1it('tab4',1,8)">愚人篇</li>
<li class="off" id="tab4_btn2" onmouseover="c1it('tab4',2,8)">爱情篇</li>
<li class="off" id="tab4_btn3" onmouseover="c1it('tab4',3,8)">儿童篇</li>
<li class="off" id="tab4_btn4" onmouseover="c1it('tab4',4,8)">成人篇</li>
<li class="off" id="tab4_btn5" onmouseover="c1it('tab4',5,8)">网络篇</li>
<li class="off" id="tab4_btn6" onmouseover="c1it('tab4',6,8)">西游篇</li>
<li class="off" id="tab4_btn7" onmouseover="c1it('tab4',7,8)">冷笑话</li>
<li class="mores"><a href="/joke/">更多</a></a></li>
</ul>
<ul>
<li class="on" id="tab4_btn0" onmouseover="c1it('tab4',0,8)">笑 话</li>
<li class="off" id="tab4_btn1" onmouseover="c1it('tab4',1,8)">愚人篇</li>
<li class="off" id="tab4_btn2" onmouseover="c1it('tab4',2,8)">爱情篇</li>
<li class="off" id="tab4_btn3" onmouseover="c1it('tab4',3,8)">儿童篇</li>
<li class="off" id="tab4_btn4" onmouseover="c1it('tab4',4,8)">成人篇</li>
<li class="off" id="tab4_btn5" onmouseover="c1it('tab4',5,8)">网络篇</li>
<li class="off" id="tab4_btn6" onmouseover="c1it('tab4',6,8)">西游篇</li>
<li class="off" id="tab4_btn7" onmouseover="c1it('tab4',7,8)">冷笑话</li>
<li class="mores"><a href="/joke/">更多</a></a></li>
</ul>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询