求各位大虾们帮帮忙啊,怎么让这个切换效果实现自动切换。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>经典灰白色vista单页面多滑动门效果代码www.duice.net</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style media=all type=text/css rel=stylesheet>
BODY {BACKGROUND: #2f6db9; MARGIN: 0px; FONT: 12px/180% "宋体",arial; COLOR: #333; TEXT-ALIGN: center}
TD {FONT-SIZE: 12px; COLOR: #333; LINE-HEIGHT: 160%; FONT-FAMILY: "宋体"}
A:link {COLOR: #333; TEXT-DECORATION: none}
A:visited {COLOR: #333; TEXT-DECORATION: none}
A:active {COLOR: #ff0000; TEXT-DECORATION: none}
A:hover {COLOR: #ff0000; TEXT-DECORATION: underline}
.menub1_1 { FONT-WEIGHT: bold; BACKGROUND: url(1703.gif) no-repeat; FLOAT: left; WIDTH: 111px; CURSOR: pointer; COLOR: #666666; LINE-HEIGHT: 25px; MARGIN-RIGHT: 4px; HEIGHT: 25px; TEXT-ALIGN: center}
.menub1_2 { FONT-WEIGHT: normal; BACKGROUND: url(1702.gif) no-repeat; FLOAT: left; WIDTH: 111px; CURSOR: pointer; COLOR: #666666; LINE-HEIGHT: 25px; MARGIN-RIGHT: 4px; HEIGHT: 25px; TEXT-ALIGN: center}
.menugtab { PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; COLOR: #cccccc; PADDING-TOP: 6px}
.menugtab A {MARGIN: 0px 10px}
</style>
</head>
<body>
<SCRIPT language=Javascript type=text/javascript>
function showtabs(m,n,count){
for(var i=1;i<=count;i++){
if (i==n){
getObject('menutab_'+m+'_'+i).style.display='';
getObject('menu_'+m+'_'+i).className='menub1_1';}
else {
getObject('menutab_'+m+'_'+i).style.display='none';
getObject('menu_'+m+'_'+i).className='menub1_2';}
}
}
function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)){
return document.getElementById(objectId);
} else if (document.all && document.all(objectId)) {
return document.all(objectId);
} else if (document.layers && document.layers[objectId]) {
return document.layers[objectId];
} else {return false;}
}function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
</SCRIPT>
<TABLE style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; MARGIN: 3px  auto 0px; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid" cellSpacing=0 cellPadding=0 width=930 bgColor=#f6f6f6 border=0>
<TBODY>
<TR>
<TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" height=30><a href="#"><IMG src="1704.gif" width=65 height=22 hspace=10 border="0"></a></TD>
<TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" vAlign=bottom align=left>      <DIV class=menub1_1 id=menu_1_1 onmouseover=showtabs(1,1,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_1_2 onmouseover=showtabs(1,2,7);>网络营销</DIV>
      <DIV class=menub1_2 id=menu_1_3 onmouseover=showtabs(1,3,7);>网页特效</DIV>
      <DIV class=menub1_2 id=menu_1_4 onmouseover=showtabs(1,4,7);>网页代码</DIV>
      <DIV class=menub1_2 id=menu_1_5 onmouseover=showtabs(1,5,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_1_6 onmouseover=showtabs(1,6,7);>图片处理</DIV>      <DIV class=menub1_2 id=menu_1_7 onmouseover=showtabs(1,7,7);>网页特效</DIV></TD></TR>
<TR>
<TD colSpan=2>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD align=middle>
     <DIV class=menugtab id=menutab_1_1><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家111</a></DIV>
     <DIV class=menugtab id=menutab_1_2 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网络营销教程222</a></DIV>
     <DIV class=menugtab id=menutab_1_3 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网站特效代码下载333</a></DIV>     <DIV class=menugtab id=menutab_1_4 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家444</a></DIV>
     <DIV class=menugtab id=menutab_1_5 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家555</a></DIV>
     <DIV class=menugtab id=menutab_1_6 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家666</a></DIV>
     <DIV class=menugtab id=menutab_1_7 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家777</a></DIV>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><TABLE style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; MARGIN: 3px  auto 0px; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid" cellSpacing=0 cellPadding=0 width=930 bgColor=#f6f6f6 border=0>
<TBODY><TR>
<TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" height=30><a href="#"><IMG src="1704.gif" width=65 height=22 hspace=10 border="0"></a></TD>
<TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" vAlign=bottom align=left>
      <DIV class=menub1_1 id=menu_2_1 onmouseover=showtabs(2,1,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_2_2 onmouseover=showtabs(2,2,7);>网络营销</DIV>
      <DIV class=menub1_2 id=menu_2_3 onmouseover=showtabs(2,3,7);>网页特效</DIV>
      <DIV class=menub1_2 id=menu_2_4 onmouseover=showtabs(2,4,7);>网页代码</DIV>
      <DIV class=menub1_2 id=menu_2_5 onmouseover=showtabs(2,5,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_2_6 onmouseover=showtabs(2,6,7);>图片处理</DIV>
      <DIV class=menub1_2 id=menu_2_7 onmouseover=showtabs(2,7,7);>网页特效</DIV></TD></TR>
<TR>
<TD colSpan=2>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD align=middle>
     <DIV class=menugtab id=menutab_2_1><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家111</a></DIV>
     <DIV class=menugtab id=menutab_2_2 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网络营销教程222</a></DIV>     <DIV class=menugtab id=menutab_2_3 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网站特效代码下载333</a></DIV>
     <DIV class=menugtab id=menutab_2_4 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家444</a>家</DIV>
     <DIV class=menugtab id=menutab_2_5 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家555</a></DIV>
     <DIV class=menugtab id=menutab_2_6 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家666</a></DIV>
     <DIV class=menugtab id=menutab_2_7 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家777</a></DIV>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><div style="clear:both;margin:20px auto">
</div>
</body>
</html>
整个页面的代码是这样的,实际效果是这样
下面这个地址是效果演示。
http://www.duice.net/UploadFiles/wzjs/wytx/hdm/hdm17.html我是从网上找的,我想让这个tab滑动门能实现自动切换,就是多少秒后自动显示下一个。我是菜鸟,自己瞎琢磨了半天也不行,麻烦大家帮帮忙。不胜感激!

解决方案 »

  1.   

    这样可以?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <TITLE>经典灰白色vista单页面多滑动门效果代码www.duice.net</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <style media=all type=text/css rel=stylesheet>
    BODY {BACKGROUND: #2f6db9; MARGIN: 0px; FONT: 12px/180% "宋体",arial; COLOR: #333; TEXT-ALIGN: center}
    TD {FONT-SIZE: 12px; COLOR: #333; LINE-HEIGHT: 160%; FONT-FAMILY: "宋体"}
    A:link {COLOR: #333; TEXT-DECORATION: none}
    A:visited {COLOR: #333; TEXT-DECORATION: none}
    A:active {COLOR: #ff0000; TEXT-DECORATION: none}
    A:hover {COLOR: #ff0000; TEXT-DECORATION: underline}
    .menub1_1 { FONT-WEIGHT: bold; BACKGROUND: url(1703.gif) no-repeat; FLOAT: left; WIDTH: 111px; CURSOR: pointer; COLOR: #666666; LINE-HEIGHT: 25px; MARGIN-RIGHT: 4px; HEIGHT: 25px; TEXT-ALIGN: center}
    .menub1_2 { FONT-WEIGHT: normal; BACKGROUND: url(1702.gif) no-repeat; FLOAT: left; WIDTH: 111px; CURSOR: pointer; COLOR: #666666; LINE-HEIGHT: 25px; MARGIN-RIGHT: 4px; HEIGHT: 25px; TEXT-ALIGN: center}
    .menugtab { PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; COLOR: #cccccc; PADDING-TOP: 6px}
    .menugtab A {MARGIN: 0px 10px}
    </style>
    </head>
    <body>
    <SCRIPT language=Javascript type=text/javascript>
    function showtabs(m,n,count){
    for(var i=1;i<=count;i++){
    if (i==n){
    getObject('menutab_'+m+'_'+i).style.display='';
    getObject('menu_'+m+'_'+i).className='menub1_1';}
    else {
    getObject('menutab_'+m+'_'+i).style.display='none';
    getObject('menu_'+m+'_'+i).className='menub1_2';}
    }
    }
    function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)){
    return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
    return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
    return document.layers[objectId];
    } else {return false;}
    }function MM_findObj(n, d) { //v4.01
      var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }function MM_showHideLayers() { //v6.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
      if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
      obj.visibility=v; }
    }

    var i=1,j=1,k=7
    function kkk () {
      showtabs(i,j,k);
    j++;
    if (j>k) {
    if (i==1) {
    i++;
    j=1
    }
    else {
    i=1;
    j=1
    }
    }
    }
    setInterval('kkk()',1000)

    </SCRIPT>
    <TABLE style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; MARGIN: 3px auto 0px; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid" cellSpacing=0 cellPadding=0 width=930 bgColor=#f6f6f6 border=0>
    <TBODY>
    <TR>
    <TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" height=30><a href="#"><IMG src="1704.gif" width=65 height=22 hspace=10 border="0"></a></TD>
    <TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" vAlign=bottom align=left>  <DIV class=menub1_1 id=menu_1_1 onmouseover=showtabs(1,1,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_1_2 onmouseover=showtabs(1,2,7);>网络营销</DIV>
      <DIV class=menub1_2 id=menu_1_3 onmouseover=showtabs(1,3,7);>网页特效</DIV>
      <DIV class=menub1_2 id=menu_1_4 onmouseover=showtabs(1,4,7);>网页代码</DIV>
      <DIV class=menub1_2 id=menu_1_5 onmouseover=showtabs(1,5,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_1_6 onmouseover=showtabs(1,6,7);>图片处理</DIV>  <DIV class=menub1_2 id=menu_1_7 onmouseover=showtabs(1,7,7);>网页特效</DIV></TD></TR>
    <TR>
    <TD colSpan=2>
    <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
    <TBODY>
    <TR>
    <TD align=middle>
      <DIV class=menugtab id=menutab_1_1><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家111</a></DIV>
      <DIV class=menugtab id=menutab_1_2 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网络营销教程222</a></DIV>
      <DIV class=menugtab id=menutab_1_3 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网站特效代码下载333</a></DIV>  <DIV class=menugtab id=menutab_1_4 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家444</a></DIV>
      <DIV class=menugtab id=menutab_1_5 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家555</a></DIV>
      <DIV class=menugtab id=menutab_1_6 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家666</a></DIV>
      <DIV class=menugtab id=menutab_1_7 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家777</a></DIV>
    </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><TABLE style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; MARGIN: 3px auto 0px; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid" cellSpacing=0 cellPadding=0 width=930 bgColor=#f6f6f6 border=0>
    <TBODY><TR>
    <TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" height=30><a href="#"><IMG src="1704.gif" width=65 height=22 hspace=10 border="0"></a></TD>
    <TD style="BORDER-TOP: #fff 1px solid; BACKGROUND: url(1701.gif) repeat-x 0px 100%" vAlign=bottom align=left>
      <DIV class=menub1_1 id=menu_2_1 onmouseover=showtabs(2,1,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_2_2 onmouseover=showtabs(2,2,7);>网络营销</DIV>
      <DIV class=menub1_2 id=menu_2_3 onmouseover=showtabs(2,3,7);>网页特效</DIV>
      <DIV class=menub1_2 id=menu_2_4 onmouseover=showtabs(2,4,7);>网页代码</DIV>
      <DIV class=menub1_2 id=menu_2_5 onmouseover=showtabs(2,5,7);>电子商务</DIV>
      <DIV class=menub1_2 id=menu_2_6 onmouseover=showtabs(2,6,7);>图片处理</DIV>
      <DIV class=menub1_2 id=menu_2_7 onmouseover=showtabs(2,7,7);>网页特效</DIV></TD></TR>
    <TR>
    <TD colSpan=2>
    <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
    <TBODY>
    <TR>
    <TD align=middle>
      <DIV class=menugtab id=menutab_2_1><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家111</a></DIV>
      <DIV class=menugtab id=menutab_2_2 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网络营销教程222</a></DIV>  <DIV class=menugtab id=menutab_2_3 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">网站特效代码下载333</a></DIV>
      <DIV class=menugtab id=menutab_2_4 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家444</a>家</DIV>
      <DIV class=menugtab id=menutab_2_5 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家555</a></DIV>
      <DIV class=menugtab id=menutab_2_6 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家666</a></DIV>
      <DIV class=menugtab id=menutab_2_7 style="DISPLAY: none"><a href="http://www.duice.net/html/list_592.html" target="_blank">中小企业网络营销专家777</a></DIV>
    </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><div style="clear:both;margin:20px auto">
    </div>
    </body>
    </html>
      

  2.   


    谢谢1楼的回答,我试了试,起到作用了,就是不太好用,还有就是这个javascript代码能在一个页面里放多个滑动门效果,我想让其中一个能实现自动切换,不知道这样行不行。
      

  3.   

    function showtabs(m,n,count){
    for(var i=1;i<=count;i++){
    if (i==n){
    getObject('menutab_'+m+'_'+i).style.display='';
    getObject('menu_'+m+'_'+i).className='menub1_1';}
    else {
    getObject('menutab_'+m+'_'+i).style.display='none';
    getObject('menu_'+m+'_'+i).className='menub1_2';}
    }
    }又见到这种很垃圾的代码了,楼主别被它带坏了,看看下面这个文章
    http://blog.csdn.net/theforever/article/details/5832244
      

  4.   

    同时有多个效果的情况,上面的文章不涉及,但加以修改就可以实现。总之那种(m,n,count)的方式,可以说是最糟糕的最没有程序思想的代码了。