分享你我的心得.
共乘一片美好网络.

js 点击显示tab代码

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="JavaScript" type="text/javascript">
<!–
if(screen.width<1000) location.href = "indexz.htm";
cook=g_cookie(‘skin’);if(cook) em(‘skinc’).href="css/css_"+cook+".css"
var tab_now = 1;
var dm;
dm=location.xiaoyebailong.com.split(‘.’)
if(dm[dm.length-1]) dm=dm[dm.length-2]+’.’+dm[dm.length-1]
else dm=dm[dm.length-3]+’.’+dm[dm.length-2]
function s(a){

if(a!=tab_now) {
   em(‘tl_’+a).className=’selectd’;
   em(‘tl_’+tab_now).className=’noselectd’;
   if(a==1) {
    em(‘fav’).style.display=’none’;
    em(‘sydh’).style.display=”;
   } else {
    em(‘sydh’).style.display=’none’;
    em(‘fav’).style.display=”;
     em(‘fav_i’).src= "http://www.1188.com/fav/" + a + ".htm";
   }
   tab_now=a;
}

}
function ssk(a) { em(‘skinc’).href="css/css_"+a+".css";s_cookie(‘skin’,a,5184000,’/’) }
function em(e){ return document.getElementById(e)}
function g_cookie(name)
{var arg = name + "=";var alen = arg.length;var c= document.cookie;var clen =c.length;var i = 0
while (i < clen){var j = i + alen
if (c.substring(i, j) == arg)
return _GetCookieVal (j)
i = c.indexOf(" ", i) + 1
if (i == 0) break}
return null}

function showsy(o)
{
var sy = document.getElementById("sy");
var childs = lib.childNodes(sy);
var channels = new Array("xl", "sh", "wy", "qq");
for (var i=0; i<childs.length; i++)
{
   if (childs[i] == o)
   {
    childs[i].className = childs[i].className.toString() + " here";

   }
   else
   {
    childs[i].className = childs[i].className.toString().replace(/here/g, "");

   }
}
}

var lib = {
childNodes: function (element)
{
   var nodes = element.childNodes;
   var _nodes = new Array();
   var j = 0;
   for (var i = 0; i < nodes.length; i ++)
   {
    if (nodes[i].nodeType == 1)
    {
     _nodes[j] = nodes[i];
     j ++;
    }
   }

   return _nodes;
},

getBody:function(s)
{
   if (document.compatMode && document.compatMode != "BackCompat")
   {
    return document.documentElement;
   }
   else
   {
    return document.body;
   }
}
}
//–></script>
<style type="text/css">
#sy{font-size: 13px;cursor:hand;}

#sy a.here{
font-weight:bold;
color: #000000;}
#sy a{
color:#ff0000;}
</style>
</head>

<body>
<table width="60%" border="0" cellpadding="0" cellspacing="0">
<tr class=’bg0′>
    <td colspan="5" height="28" style="padding:0 0 0 12;"><div id="sy"><a href="/" target="_self" onClick="s(1);return false" id="tl_1" class="here" onMouseMove="showsy(this);">第一</a> <span class="sy">|</span> <a href="/" target="_self" onClick="s(2);return false" id="tl_2" onMouseMove="showsy(this);">第二</a> <span class="sy">|</span> <a href="/" target="_self" onClick="s(3);return false" id="tl_3" onMouseMove="showsy(this);">第三</a> <span class="sy">|</span> <a href="/" target="_self" onClick="s(4);return false" id="tl_4" onMouseMove="showsy(this);">第四</a> <span class="sy">|</span> <a href="/" target="_self" onClick="s(5);return false" id="tl_5" onMouseMove="showsy(this);">第五</a></div></td>
</tr>
<tr>
    <td><table width="685" height="205" border="0" cellpadding="0" cellspacing="0"id="sydh">
      <tr class="ju">
        <td style="padding-left:20px;">00</td>
        </tr>
    </table>
        <div id="fav" style="display:none">
          <iframe allowtransparency="true" id="fav_i" name="fav_i" src="about:blank" scrolling="No" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="205"></iframe>
        </div></td>
</tr>
</table>
</body>
</html>

赞(0)
未经允许不得转载:小叶白龙博客 » js 点击显示tab代码
分享到: 更多 (0)

评论 2941

评论前必须登录!