JS+CSS实现的蓝色table选项卡效果

这是一款蓝色的JS+Table类型的选项卡,部分标签内容存储在JS数组,个人感觉本特效不是太合理,因为内容从Js里输出会给读取内容造成很大麻烦,这里你就当学习一种JS编程方法,代码是需要改进的。

先来看看运行效果截图:

JS+CSS实现的蓝色table选项卡效果

在线演示地址如下:

具体代码如下:

<html> <head> <title>选项卡</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> td,a,body{font-size:9pt;color:#000000;} .DivAround_focus{cursor:pointer;background-color:#A1ACDB;border-right:solid 1px #A1ACDB;border-bottom:solid 1px #333333; border-left:solid 1px #C8CEEA; border-top:solid 1px #C8CEEA} .DivAround_blur{cursor:pointer;background:#4D5C9F;border-right:solid 1px #eeeeee;border-bottom:solid 1px #333333; border-left:solid 1px #798ACC; border-top:solid 1px #A1ACDB;color:#FFFFFF} .DivAround_content{background-color:#A1ACDB;border-right:solid 1px #888888;border-bottom:solid 1px #555555; border-left:0px; border-top:solid 1px #C8CEEA;} </style> </head> <body> <script language="javascript"> var AroundInfoArray=new Array(); AroundInfoArray[0]="脚本资源"; AroundInfoArray[1]="网页技巧集"; AroundInfoArray[2]="IT资讯坊"; function ChangeFocus(obj) { for(i=0;i<document.getElementById("leftButtonTAble").rows.length;i++) { if(document.getElementById("leftButtonTAble").rows[i].cells[0]==obj) { document.getElementById("leftButtonTAble").rows[i].cells[0].className="DivAround_focus"; document.getElementById("DivAroundContent").innerHTML=AroundInfoArray[i]; }else{ document.getElementById("leftButtonTAble").rows[i].cells[0].className="DivAround_blur"; } } } </script> <table cellpadding="0" cellspacing="0" bgcolor="#6271B1"><tr><td valign="top"> <table cellpadding="0" cellspacing="0"> <tr><td>脚本代码</td></tr> <tr><td>网页技巧</td></tr> <tr><td>IT坊</td></tr> <tr><td>&nbsp;</td></tr> </table> </td><td> <table cellpadding="0" cellspacing="0"> <tr><td valign="top">内容</td></tr> </table> </td></tr> </table> <script language="javascript">ChangeFocus(document.getElementById("leftButtonTAble").rows[0].cells[0]); </script> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wggwjy.html