I've recently discovered a website which does something really cool! Example:
- There are two links "Cat" and "Dog".
- There are two DIV containers, id="catImage" and id="dogImage"
- The initial URL looks like http://mysite.com/#cat
- Initially, the cat image is visible
- Clicking on the Dog link will fade out the
catImage
div and fade in thedogImage
div - Additionally, it will change the anchor in the browser URL to: http://mysite.com/#dog
- Opening the website with httü://mysite.com/#dog will show the dog image initially
Is this possible using jQuery? How would I scan for that anchor, and how would I call a function when the link is clicked without causing the link to follow some URL? I'm an objective-c dude and don't know anything about JS... hope my question isn't too dumb for you.