Js tab effect code enhanced version

Source: Internet
Author: User

<Style> body {font-family: Arial, ""; font-size: 9pt ;}td {font-size: 12px ;;}. mousehand {cursor: hand ;}. titletable {padding-left: 5px; background-color: # E9E9E9;} table. tabBarLevel1 {} table. tabBarLevel1 td {border: 1px solid # CCCCCC; height: 20px; background-color: # E1E1E1;} table. tabBarLevel1 td. selected {border-bottom-width: 0px; background-color: # ffffff;} table. tabBarLevel1 td. black {border-left-width: 0px; border-top-width: 0px; border-right-width: 0px; background-color: # FFFFFF;} table. content {border-left: 1px solid # CCCCCC; border-right: 1px solid # CCCCCC; border-bottom: 1px solid # cccccccc ;} </style> <table width = "600" border = "0" cellspacing = "0" cellpadding = "0"> <tr> <td> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" class = "TabBarLevel1" id = "TabPage1"> <tr align = "center"> <td width = "130 ""id =" imageTab1 "valign =" middle "class =" mousehand "onclick =" javascript: switchTab ('tabpage1 ', 'imagetab1', 'heartbleed, 'image '); "> popular images </td> <td width =" 7 "class =" Black "> </td> <td width =" 80 "id =" imageTab2 "valign =" middle "class =" mousehand "onclick =" javascript: switchTab ('tabpage1 ', 'imagetab2', 'virtual web', 'image '); "> bohemian </td> <td width =" 7 "class =" Black "> </td> <td width =" 80 "id =" imageTab3 "valign =" middle "class =" Selected mousehand "onclick =" javascript: switchTab ('tabpage1 ', 'imagetab3', 'unique visitor, 'image '); "> Red Hacker </td> <td width =" 7 "class =" Black "> </td> <td width =" "align =" right "class =" Black "> script house </td> </tr> </table> <table width =" 100% "border =" 0 "cellpadding =" 0 "cellspacing =" 0 "class =" content "> <tr> <td height =" 110 "> loading... </td> </tr> </table>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The effect of content control added based on it
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Function $ (objName)
{

If (document. getElementById)
{
Return document. getElementById (objName );
}
Else if (document. layers)
{
Return eval ("document. layers ['" + objName + "']");
}
Else
{
Return eval ('document. all. '+ objName );
}
}
Function switchTab (tabpage, tabid, action, type ){
Var oItem = $ (tabpage );
For (var I = 1; I <6; I ++ ){
Var x = $ (type + 'tab '+ I );
// Alert (x );
X. className = "mousehand ";
// Var y = x. getElementsByTagName ('A ');
// Y [0]. style. color = "#333333 ";
}
$ (Tabid). className = "Selected ";
// Gethotimagelist (type + '_' + action );
Closeall (action );
$ (Action). style. display = "block ";
}
Function closeall (action ){
For (var ii = 1; ii <5; ii ++ ){
Var noclose;
Noclose = "div" + ii;
If (noclose! = Action ){
$ (Noclose). style. display = "none ";
}
}
}
</Script>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.