Asking questions. Set the header.php how to follow the different buttons of the click to set the corresponding button style

Source: Internet
Author: User
Set the header.php how to follow the different buttons of the click to set the corresponding button style


header.php is a navigation bar with several buttons pointing to different pages,
I want the effect is to press the first button into the 1.php, and then the first button can have a background color, press the second button to enter the 2.php, and then the second button can have a background color, the first button becomes the original appearance.


Reply to discussion (solution)

Http://www.16sucai.com/daima/cd/This? A lot of people have written it directly add to their project

You can not use JS to judge and then how to do

Please introduce jquery into the page.
header.php Code:

 
 
  
 
        Page 1 on         page 2   


1.php Code:
 
        Page 1 on         page 2   


2.php Code:

 
        Page 1         on page 2   after running, you will get what you want.
  • 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.