Javascript _ javascript tips

Source: Internet
Author: User
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 instances
  • VB source program for image brightness adjustment based on Photoshop Curves
  • The form interface of the VC-like RealonePlayer player
  • Farbtastic jQuery circular webpage color selection plug-in
  • Delphi basic learning instance code
  • Java library management program code
  • I hope this article will help you design JavaScript programs.

    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.