homepage Welcome to WebmasterWorld Guest from 54.237.213.31
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
invoking OnHashChange w/specific bookmark
sssweb

5+ Year Member



 
Msg#: 4404174 posted 8:55 pm on Jan 5, 2012 (gmt 0)

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

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4404174 posted 9:15 am on Jan 6, 2012 (gmt 0)

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

5+ Year Member



 
Msg#: 4404174 posted 12:41 pm on Jan 6, 2012 (gmt 0)

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

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4404174 posted 1:36 pm on Jan 6, 2012 (gmt 0)

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.)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved