Results 1 to 3 of 3

Thread: Unlocking the href element inside my collapsing menu

  1. #1
    Join Date
    Nov 2009
    Posts
    107
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Default Unlocking the href element inside my collapsing menu

    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
    Last edited by itivae; 04-13-2012 at 10:11 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Change:

    Code:
    window.open($(this).attr('href'));
    to:

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    itivae (04-13-2012)

  4. #3
    Join Date
    Nov 2009
    Posts
    107
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Default

    Thanks you very much.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •