点击标签切换和机关注换DIV选项卡,自动切换d

2019-07-27 作者:网站首页   |   浏览(127)

复制代码 代码如下:

点击标签切换和自动切换DIV选项卡,自动切换div

复制代码 代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>点击切换和自动切换选项卡</title>
<style type="text/css">
*{list-style:none;margin:0;padding:0;overflow:hidden}
.tab1{width:401px;border-top:#A8C29F solid 1px;border-bottom:#A8C29F solid 1px;margin:50px 200px;}
.menu{width:400px;background:#eee;height:28px;border-right:#A8C29F solid 1px;border-bottom:#A8C29F solid 1px;}
li{float:left;width:99px;text-align:center;line-height:28px;height:28px;cursor:pointer;border-left:#A8C29F solid 1px;color:#666;font-size:14px;overflow:hidden}
.menudiv{width:399px;height:300px;border-left:#A8C29F solid 1px;border-right:#A8C29F solid 1px;border-top:0;background:#fefefe}
.menudiv div{padding:15px;line-height:28px;}
.off{background:#E0E2EB;color:#336699;font-weight:bold}
</style>
<script type="text/javascript">
function setTab(name,cursel){
cursel_0=cursel;
for(var i=1; i<=links_len; i ){
var menu = document.getElementById(name i);
var menudiv = document.getElementById("con_" name "_" i);
if(i==cursel){
menu.className="off";
menudiv.style.display="block";
}
else{
menu.className="";
menudiv.style.display="none";
}
}
}
function Next(){
cursel_0 ;
if (cursel_0>links_len)cursel_0=1
setTab(name_0,cursel_0);
}
var name_0='one';
var cursel_0=1;
var links_len,iIntervalId;
onload=function(){
var links = document.getElementById("tab1").getElementsByTagName('li')
links_len=links.length;
for(var i=0; i<links_len; i ){
links[i].onmouseover=function(){
clearInterval(iIntervalId);
}
}
document.getElementById("con_" name_0 "_" links_len).parentNode.onmouseover=function(){
clearInterval(iIntervalId);
}
setTab(name_0,cursel_0);
}
</script>
</head>
<body>
<h3> </h3>
<div class="tab1" id="tab1">
<div class="menu">
<ul>
<li id="one1" onclick="setTab('one',1)">标签1</li>
<li id="one2" onclick="setTab('one',2)">标签2</li>
<li id="one3" onclick="setTab('one',3)">标签3</li>
<li id="one4" onclick="setTab('one',4)">标签4</li>
</ul>
</div>
<div class="menudiv">
<div id="con_one_1"><h4 style="color:red">标签1-内容</h4></div>
<div id="con_one_2" style="display:none;"><h4 style="color:red">标签2-内容</h4></div>
<div id="con_one_3" style="display:none;"><h4 style="color:red">标签3-内容</h4></div>
<div id="con_one_4" style="display:none;"><h4 style="color:red">标签4-内容</h4></div>
</div>
</div>
</body>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>点击切换和自动切换选项卡</title>
<style type="text/css">
*{list-style:none;margin:0;padding:0;overflow:hidden}
.tab1{width:401px;border-top:#A8C29F solid 1px;border-bottom:#A8C29F solid 1px;margin:50px 200px;}
.menu{width:400px;background:#eee;height:28px;border-right:#A8C29F solid 1px;border-bottom:#A8C29F solid 1px;}
li{float:left;width:99px;text-align:center;line-height:28px;height:28px;cursor:pointer;border-left:#A8C29F solid 1px;color:#666;font-size:14px;overflow:hidden}
.menudiv{width:399px;height:300px;border-left:#A8C29F solid 1px;border-right:#A8C29F solid 1px;border-top:0;background:#fefefe}
.menudiv div{padding:15px;line-height:28px;}
.off{background:#E0E2EB;color:#336699;font-weight:bold}
</style>
<script type="text/javascript">
function setTab(name,cursel){
cursel_0=cursel;
for(var i=1; i<=links_len; i ){
var menu = document.getElementById(name i);
var menudiv = document.getElementById("con_" name "_" i);
if(i==cursel){
menu.className="off";
menudiv.style.display="block";
}
else{
menu.className="";
menudiv.style.display="none";
}
}
}
function Next(){
cursel_0 ;
if (cursel_0>links_len)cursel_0=1
setTab(name_0,cursel_0);
}
var name_0='one';
var cursel_0=1;
var links_len,iIntervalId;
onload=function(){
var links = document.getElementById("tab1").getElementsByTagName('li')
links_len=links.length;
for(var i=0; i<links_len; i ){
links[i].onmouseover=function(){
clearInterval(iIntervalId);
}
}
document.getElementById("con_" name_0 "_" links_len).parentNode.onmouseover=function(){
clearInterval(iIntervalId);
}
setTab(name_0,cursel_0);
}
</script>
</head>
<body>
<h3> </h3>
<div class="tab1" id="tab1">
<div class="menu">
<ul>
<li id="one1" onclick="setTab('one',1)">标签1</li>
<li id="one2" onclick="setTab('one',2)">标签2</li>
<li id="one3" onclick="setTab('one',3)">标签3</li>
<li id="one4" onclick="setTab('one',4)">标签4</li>
</ul>
</div>
<div class="menudiv">
<div id="con_one_1"><h4 style="color:red">标签1-内容</h4></div>
<div id="con_one_2" style="display:none;"><h4 style="color:red">标签2-内容</h4></div>
<div id="con_one_3" style="display:none;"><h4 style="color:red">标签3-内容</h4></div>
<div id="con_one_4" style="display:none;"><h4 style="color:red">标签4-内容</h4></div>
</div>
</div>
</body>

Maxthon2怎使打开的新标签栏自动切换到新选项卡上?

汗……那我没折了,如果是我,我就选择把傲游载了(包括配置数据)然后重装下傲游。

补充:打上勾以后,将滚动条拉到顶部,那上面有个”应用”,要点击那个应用后才会生效

工具--选项—Maxthon选项—标签栏—激活新标签 那一排里有个"鼠标单击和 Shift 单击"打上勾 ,然后点上面的应用,就可以了  

页面切换代码 要div css

<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>tab</title> <style type="text/css"> ul,li,div{ margin: 0; padding: 0; } #tab{ height: 30px; line-height: 30px; width: 600px; margin: 0 auto; } #tab li{ width: 80px; text-align: center; float: left; list-style: none; } #tab li.current{ background: #999; color: #f60; } #tab-panel{ clear: both; position: relative; width: 600px; margin: 0 auto; } #tab-panel .panel{ display:none; } #tab-panel .current{ display: block; } #tab-panel .more{ position: absolute; right: 4px; top: -30px; line-height: 30px; } </style></head><body> <ul id="tab"> <li class="current"><a href="#num-1">一号</a></li> <li><a href="#num-2">二号</a></li> <li><a href="#num-3">三号</a></li> </ul> <div id="tab-panel"> <div id="num-1" class="panel current"> <......余下全文>>  

复制代码 代码如下: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" head meta http-equiv="Conte...

本文由yzc216亚洲城发布于网站首页,转载请注明出处:点击标签切换和机关注换DIV选项卡,自动切换d

关键词: yzc216亚洲城