How do I remember li on the right side of the usersettings page in segmentfault after I click Refresh?

Source: Internet
Author: User
After I click "Work and Education Experience", the page is refreshed. The activated project becomes "Work and Education Experience". How does this happen? Which li is sent from the background to the foreground to be activated? Or other implementation methods?

After I click "Work and Education Experience", the page is refreshed. The activated project becomes "Work and Education Experience". How does this happen?

Which li is sent from the background to the foreground to be activated? Or other implementation methods?

Reply content:

After I click "Work and Education Experience", the page is refreshed. The activated project becomes "Work and Education Experience". How does this happen?

Which li is sent from the background to the foreground to be activated? Or other implementation methods?

Input parameters based on URL$tabJudge current page


  
  • class="current" >xxx
  • class="current" >xxx
  • First, thank you for inviting me to answer. Then your so-called activation is actuallyliAssignedclass="current"Attribute. This is easier to judge.

    SegmentFault should be determined at the backend. The theme of this WordPress program is written. The idea should be the same as that of your program. Each of them will judge whether it is the current page, no.

    However, I recently wrote a static blog topic and found that they have such an idea. The program hasextendsAndblockFunction, which can define the parent template and rewrite items. For examplebase.htmlThis defines

    
      
       
    Hello, I am the homepage.
       
        
    Hello, I'm a user page.
        
         
    Hello, I am an article page.
        
       
      

    Then I write this in the user page

    {% Extends 'base.html '% }{# inherit inherits base.html #}{ % block user %} class = "current" {% endblock % }{# indicates that the preceding definition can be rewrite item assignment #}

    In the end, my user page will display this effect.

  • Hello, I am the homepage.
  • Hello, I'm a user page.
  • Hello, I am an article page.
  • This can also achieve the goal. Of course, you can also choose to judge at the front end to give eachliAdd a correspondingclass, Best andURLThe same call name, and then accordingURLThe value is directly assigned to the corresponding object.

    In general, if you don't want

  • If you add a separate logo, you can only judge the backend/front-end one by one. If you add a separate logo, you can do it quickly. The backend/front-end is not limited.
  • 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.