Solved

Jquery location hash change

Posted on 2012-03-31
1
636 Views
Last Modified: 2012-04-01
I have a menu with 5 li > a items.
Each item when clicked launches a jquery function.
With each menu click I would like to update the location.hash like for example:
click item 1 > function one() is called and location hash gets a #one appened at the end
click item 2 > function two is called and location hash gets a #two appened at the end
and so on

Also, and this is the most important part, if I manually changed the URL of the page from let's say:   siteURL#one to siteURL#two, then automatically the function two() should be called.

Is this possible?
Thanks in advance
0
Comment
Question by:badwolfff
1 Comment
 
LVL 3

Accepted Solution

by:
animecyc earned 500 total points
ID: 37791904
This is possible both with and without jQuery. One of my favorite plugins to use is this one: jQuery Address

It is both easy to use and very well documented.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now