PDA

View Full Version : Resolved Unlocking the href element inside my collapsing menu



itivae
04-13-2012, 01:46 AM
Hello all, I have a small problem with some code. I have an expandable and contractible list. but the javascript that releases the link function asks for a new window.

$('#cvList a').unbind('click').click(function() {
window.open($(this).attr('href'));
return false;
});

This opens the link in a new window. I, however, am trying to use it to link to anchors. Can anyone help me release the unbind function to the same page?

Thanks

jscheuer1
04-13-2012, 02:18 PM
Change:



window.open($(this).attr('href'));

to:


location.hash = this.hash;

If the link doesn't have a jQuery click() associated with it already, you can just skip everything in your post.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

itivae
04-13-2012, 10:12 PM
Thanks you very much. :)