This article is an example of how JS implements the Windows Style tab and button effects. Share to everyone for your reference. The implementation methods are as follows:
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 5, 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 11 9 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148-149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179-18 0 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209-210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237-238 |
<html> <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/> <head> <style type=" Text/css "> <!--body{font-family: ' MS Shell Dlg ', Arial, Tahoma; fon t-size:12px; Background-color: #336699; Color: #000000; TD, Div, input, textarea{font-family: ' MS Shell Dlg ', Arial, Tahoma; font-size:12px; cursor:default; title{Backgroun D-color: #000080; Color: #fdf7d3; Padding:1; Font-family: Song body; font-size:12px; }. up{Background-color: #cccccc; color: #000000; border:2px outset #ffffff} down{background-color: #cccccc; border:2px Inset #ffffff}. up1{background-color: #cccccc; color: #000000; border:1px outset #ffffff}. down1{Background-color: #c CCCCC; border:1px inset #ffffff {background-color: #cccccc; height:18px; border-left:2px outset #ffffff; border-right:2p x outset #ffffff; Color: #000000; border-top:2px outset #ffffff; Padding-top:2; HEIGHT:18}. LC {background-color: #cccccc; height:18px; border-left:2px outset #ffffff; border-right:2px outset #ffffff; Color: #000000; border-top:2px outset #ffffff; Padding-top:2; HEIGHT:20}. l-h{Background-color: #cccccc; border-left:2px outset #ffffff; border-top:2px outset #ffffff; color: #0000 00; }. l-c{Background-color: #cccccc; border-top:2px outset #ffffff}. l-r {background-color: #cccccc; border-right:2px ou Tset #ffffff; border-top:2px outset #ffffff; Color: #000000; }. l-hc{Background-color: #cccccc; border-left:2px outset #ffffff; color: #000000; l-cc{Background-color: #cccccc; co Lor: #000000; }. L-RC {background-color: #cccccc; border-right:2px outset #ffffff; color: #000000;} td{color: #000000;}--> </s Tyle> <title> Display Properties </title> <meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "></head> <body style=" Border:outset 1 #ffffff margin:0;background-color: #cccccc;p adding : 3px "scroll=no> <script language=" JavaScript > <!--function Restore () {td1.classname= "L"; td2.classname= "L"; Td3.classnAme= "L"; Td4.classname= "L"; Td5.classname= "L"; Td6.classname= "L"; Td_1.classname= "L-h"; Td_2.classname= "L-c"; Td_3.classname= "L-c"; Td_4.classname= "L-c"; Td_5.classname= "L-c"; Td_6.classname= "L-c"; W1.style.display= "None"; W2.style.display= "None"; W3.style.display= "None"; W4.style.display= "None"; W5.style.display= "None"; W6.style.display= "None"; function C1 () {td1.classname= "LC"; Td_1.classname= "L-HC"; w1.style.display= "block";} function C2 () {td2.classname= "L C "; Td_2.classname= "L-CC"; w2.style.display= "Block"; function C3 () {td3.classname= "LC"; Td_3.classname= "L-CC"; w3.style.display= "block";} function C4 () {td4.classname= "L C "; Td_4.classname= "L-CC"; w4.style.display= "Block"; function c5 () {td5.classname= "LC"; Td_5.classname= "L-CC"; w5.style.display= "block";} function C6 () {td6.classname= "L C "; Td_6.classname= "L-CC"; w6.style.display= "Block"; //--> </SCRIPT> <form name= "free" method= "post" target= "_target" > <div align= "Center" > < Center> <tAble border= "0" cellpadding= "0" cellspacing= "0" width= "height=" "> <tr> <td width=" height= "20" align= "center" valign= "Bottom" Onclick=restore () C1 ();> <div id= "TD1" class= "LC" > Background </div></td> <TD width= "height=" align= "center" valign= "Bottom" onclick=restore (); C2 ();> <div id= "TD2" class= "L" > screensavers </div></td> <td width= "height=" align= "center" valign= "Bottom" onclick=restore (); C3 (); > <div id= "td3" class= "L" > Appearance </div></td> <td width= "height=" Center "align=" Bottom "Onclick=restore () C4 ();> <div id=" td4 "class=" L ">Web</div></td> <td width=" m "Height = "align=" "Center" valign= "Bottom" onclick=restore () C5 ();> <div "id=" TD5 "L" > Effect class= > <td width= "height=" align= "center" valign= "Bottom" onclick=restore (); C6 ();> <div id= "Td6" class= "l "> Settings </div></td> <td width=" height= "align=" centER "valign=" bottom ></td> <td width= "height=" align= "center" valign= "bottom" ></td> </ tr> <tr style= "" > <td width= "height=" 1 "align=" center "class=" L-HC "id=" Td_1 "> </td> <td Widt H= "height=" 1 "align=" center "class=" l-c "id=" Td_2 "> </td> <td" width= "height=" 1 "align=" Center "class = "L-c" id= "Td_3" > </td> <td width= "1" height= "align=" center "class=" l-c "id=" Td_4 "> </td> < TD width= "Height=" "1" align= "center" class= "l-c" id= "Td_5" > </td> <td width= "height=" 1 "align=" center "Class=" l-c "id=" Td_6 "> </td> <td width=" 1 "height=" align= "center" class= "l-c" id= "Td_" > </td> <TD width= "height=" 1 "align=" center "class=" L-r "id=" Td_ "> </td> </tr> <tr> <td width=" 398 "height=" 360 "class=" Up "colspan=" 8 "style=" BORDER-TOP-STYLE:SOLID; border-top-width:0; Padding:5 "> <p align=" center "> <div align=" center "> ≪table border= "0" cellpadding= "0" cellspacing= "0" width= "100%" height= "325" > <tr> <td width= "100%" height = "280" > <div align= "center" > <center> <div style= "Display:" id=w1><h1>1</h1></ div> <div style= "Display:none" id=w2><h1>2</h1></div> <div "style=" Display:none ><h1>3</h1></div> <div style= "Display:none" id=w4><h1>4</h1></div> <div style= "Display:none" id=w5><h1>5</h1></div> <div style= "Display:none" id=w6>< h1>6</h1></div> </center> </div> </td> </tr> </table> </div> </ td> </tr> </center> <tr> <td width= "398" height= "Notoginseng" colspan= "8" style= "Border-top-style:solid" ; border-top-width:0; Padding:5 "> <p align=" right "><input type=" button "value=" OK "name=" _OK "style=" width:60;height:22 "class= "Up" > <input type= "button" value= "Cancel" namE= "_cancel" style= "width:60;height:22" class= "Up" onclick= "window.close ();" > <input type= "button" value= "Application (A)" Name= "_apply" style= "width:60;height:22" Disabled class= "up" > </td > </tr> </table> </div> </form> </body> </html> |
The operation effect is as follows:
I hope this article will help you with your JavaScript programming.