This article mainly introduces how to change the sliding door of JS to a tab (with mouse clicks required). It involves techniques related to JavaScript page element traversal and style replacement, you can use onmouseover and onclick to implement the sliding door and tabs respectively. If you need them, refer to the example in this article to illustrate how JS can change the sliding door to a tab (you need to click the mouse. Share it with you for your reference. The details are as follows:
As we all know, sliding doors and tabs are almost the same in layout and structure. The only difference is the trigger method, which is determined by JavaScript, in general, you just need to change onmouseover to onclick. This tab is a popular sliding door before, and now it is changed to a tab. Let's see what the difference is.
The running effect is as follows:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-hdm-2-nav-tab-style-demo/
The Code is as follows:
Sliding Door changed to TabScript function $ (ID) {return document. getElementById (ID)} function showTab (ID) {for (var I = 1; I <7; I ++) {if (ID = I) {$ ('tab '+ I ). blur (); $ ("tab" + I ). className = "on"; $ ("cont" + I ). style. display = "block";} else {$ ("tab" + I ). className = "off"; $ ("cont" + I ). style. display = "none" ;}} return false;} script
- C # source code
- VB source code
- VC source code
- JQUERY script
- Delphi code
- JAVA source code
Over 30 C # basic learning instancesVB source program for image brightness adjustment based on Photoshop CurvesThe form interface of the VC-like RealonePlayer playerFarbtastic jQuery circular webpage color selection plug-inDelphi basic learning instance codeJava library management program code
I hope this article will help you design JavaScript programs.