My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 23, 2008 by hhh333
AnchorHandler  

jquery.anchorhandler.js

Author Copyright (c) 2007-2008 Maxime Haineault (haineault.com)
License MIT License

This jQuery plugin allow to use regular expressions to attach events on url hanchor.. it's less complicated and more useful than it sounds :)

It's a clever and neat way to handle custom URLs that I borrowed from django's clever URL dispatcher.

Example

$.anchorHandler
    .add(/\#show\-something/,   function(){ /* ..*/  })
    .add(/\#trigger\-event/,    someEvent)
    .add(/\#/,                  smoothScrollToLink);

Sign in to add a comment
Hosted by Google Code