Can you trigger click on URL with hashtag?
For example:
I have this link: <a class="contact">Contact Me</a>
and when I visit www.example.com/#contact
to fire: $('a.contact').trigger('click');
Is this possible by any hacky way?
Can you trigger click on URL with hashtag?
For example:
I have this link: <a class="contact">Contact Me</a>
and when I visit www.example.com/#contact
to fire: $('a.contact').trigger('click');
Is this possible by any hacky way?
You should be able to capture the
hashchange
event using the jQuery BBQ plugin (see last example on this page). Something along these lines should work:This should not only work when you first load the page, but also when something else changes the fragment.