Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:22:30+00:00 2026-06-17T17:22:30+00:00

this is a bit tricky to explain: We got a website that contains various

  • 0

this is a bit tricky to explain:
We got a website that contains various menus and apart from normal links it also has anchorlinks.
Now it’s not the problem to have the links generated there, but it is also desired to give them an “active”-state (= you’re on that website), specifically when you jumped to that section.

<ul class="active">
  <li class="active">
    <a href="index.php?id=30">Subsite</a>
    <ul>
      <li><a href="index.php?id=30#section_1">Section 1</li>
      <li><a href="index.php?id=30#section_2">Section 2</li>
      <li><a href="index.php?id=30#section_3">Section 3</li>
      <li><a href="index.php?id=30#section_4">Section 4</li>
    </ul>
  </li>
</ul>

Normal link behaviour:

You’re on home, you click in the menu and get to index.php?id=30
When you’re on id=30, the menu point will highlight.

How an active anchor should behave:

You’re on home, you click in the menu and get to index.php?id=30#section_1. When you’re on id=30, it’s not highlighted, but when you follow the link and are on id=30#section_1, it is (based on what is entered in the locationbar). When you remove the anchor in the locationbar and confirm, the highlighting should be removed (afaik, the website won’t reload, but jump to another section).

Is it possible to react to this jump-behaviour and listen to changes done to the location bar? Or do you have a different idea how to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:22:31+00:00Added an answer on June 17, 2026 at 5:22 pm

    As Marc Baumbach pointed out in the comments-section to my question, this is exactly what I was looking for:

    On – window.location.hash – Change?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a deceptively tricky little bit of HTML/JS that has either me or
This might be a bit tricky setup but... I have this Silverlight project that
this is a little bit tricky. usually when someone clicks on a link that
This is a bit tricky to explain, but I will do my best. Say
This is tricky and tough to explain, that's why I created a jsfiddle to
This is a bit tricky to explain but I will try my best to
This is a bit tricky to explain, i'm making an API where i take
This one is a bit tricky to explain. I have a usercontrol with some
This is a bit tricky question for you computer scientists. Let's say that I
This one is a bit tricky to explain so I accept more detail may

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.