[jQuery] location.hash event

[jQuery] location.hash event


Is there an event fired when the location hash changes?
I really need this as I'm using js to modify id's on ready so that
when the browser hash changes I handle the scrolling rather than the
browser jumping to the target. This all works fine, apart from the
final piece of the jigsaw, the browsers back and forward buttons.
For example
<div id="test"></div> becomes <div id="test-a"></div> so I can handle
click events to target the correct location and also direct links
http://local/#test, but what I can't do is get the back and forward
buttons to work without and event being fired.
Any ideas?
Thanks