Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2008
    Location
    Liverpool
    Posts
    53
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Question jQuery UI Accordion - Possible to deep-link?

    I'm trying to link from one page to a H2 on another page. Simple enough usually, just use the good old #. However, the H2's in question are on the same page as a jQuery UI accordion, which means that it does link to the new page, however, after the accordion has been rendered, the page is not lined up to the H2.

    Is there any way I can workaround this?

    I would be really grateful if anyone can help me out.

    Thanks
    Scott

  • #2
    New Coder
    Join Date
    Aug 2008
    Location
    Liverpool
    Posts
    53
    Thanks
    37
    Thanked 0 Times in 0 Posts
    Have tried this:
    $(document).scrollTop(getRealTop(accordian));
    function getRealTop(el){
    yPos = document.getElementById(el).offsetTop;
    tempEl = document.getElementById(el).offsetParent;
    while (tempEl != null) {
    yPos += tempEl.offsetTop;
    tempEl = tempEl.offsetParent;
    }
    return yPos;
    }

    but couldn't get it to work!!!! doh!!!

  • #3
    New Coder
    Join Date
    Aug 2008
    Location
    Liverpool
    Posts
    53
    Thanks
    37
    Thanked 0 Times in 0 Posts
    Is there anybody who could shed some light on this? I'd really like to be able to deep link to the H2 on the page using jQuery UI Accordion, any help will be gratefully received. :0)

  • #4
    New Coder
    Join Date
    Aug 2008
    Location
    Liverpool
    Posts
    53
    Thanks
    37
    Thanked 0 Times in 0 Posts
    Ho hum, back to the drawing board, cannot find a way around this :0(


  •  

    Tags for this Thread

    Posting Permissions

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