Skip to content Skip to sidebar Skip to footer

How To Link To Specific Anchor In Table With Jquery

I am using this jquery plugin: http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx I have anchors in the code such as: ) $(document.location.hash).click(); });

This would make for example www.yoursite.com/yourPage.htm#art2 perform a click on that link causing it to open. Just make sure the above code is after your click event handler, so it actually does something on click :)

If you're landing on #art using the named anchor, similar approach:

$(function() {
  if(document.location.hash != '')
    $('a[name="' + document.location.hash.replace('#','') + '"]').click();
});

Post a Comment for "How To Link To Specific Anchor In Table With Jquery"