Reputation: 21924
I have a div, "section" on a page, samplepage.html that I have set the display to "none"
<h3>Title</h3>
<a name="print">
<div class="section" style="display:none">
<p>Loreum ipsum text</p>
</div>
When the user clicks from another page:
<a href="samplepage.html#print">link</a>
I would like to make the "section" div slide open (slideToggle)...is this possible? I don't know how to trigger an event from a click handler on another page...
Upvotes: 0
Views: 1506
Reputation:
There are several libs for handling url routes like this. You may take a look a backbone.js route: http://documentcloud.github.com/backbone/#Router
I would recommend this if you have a lot of routing in your app
Upvotes: 1
Reputation: 224867
Try this, in a ready
handler:
if(document.location.hash) {
$('.' + document.location.hash.substring(1)).slideDown();
}
Upvotes: 3