Forum Moderators: open

Message Too Old, No Replies

invoking OnHashChange w/specific bookmark

         

sssweb

8:55 pm on Jan 5, 2012 (gmt 0)

10+ Year Member



Is it possible to invoke OnHashChange when the hash changes to a specific value, as opposed to any changed hash value?

If so, how would I do that? I have a jQuery slideshow script that automatically changes the hash w/each new slide. I want to call certain js functions for specific slides.

penders

9:15 am on Jan 6, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need to check for the 'specific value' in the onHashChange event. Unless jQuery has a shortcut/filter? But ultimately JavaScript will be firing the event for every change.

sssweb

12:41 pm on Jan 6, 2012 (gmt 0)

10+ Year Member



Thanks penders -- yes, I discovered a way to do exactly that w/in the jQuery script itself; wanted to test it before posting here. It works perfect.

penders

1:36 pm on Jan 6, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So, do you have to explicitly check for the specific value in your script, or did you find a jQuery shortcut? (I don't use jQuery that much.)