Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-16-2012, 11:41 AM   PM User | #1
snarf1974
New Coder

 
Join Date: Aug 2008
Location: Liverpool
Posts: 53
Thanks: 37
Thanked 0 Times in 0 Posts
snarf1974 is an unknown quantity at this point
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
snarf1974 is offline   Reply With Quote
Old 08-21-2012, 01:28 PM   PM User | #2
snarf1974
New Coder

 
Join Date: Aug 2008
Location: Liverpool
Posts: 53
Thanks: 37
Thanked 0 Times in 0 Posts
snarf1974 is an unknown quantity at this point
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!!!
snarf1974 is offline   Reply With Quote
Old 08-22-2012, 11:49 AM   PM User | #3
snarf1974
New Coder

 
Join Date: Aug 2008
Location: Liverpool
Posts: 53
Thanks: 37
Thanked 0 Times in 0 Posts
snarf1974 is an unknown quantity at this point
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)
snarf1974 is offline   Reply With Quote
Old 08-24-2012, 11:00 AM   PM User | #4
snarf1974
New Coder

 
Join Date: Aug 2008
Location: Liverpool
Posts: 53
Thanks: 37
Thanked 0 Times in 0 Posts
snarf1974 is an unknown quantity at this point
Ho hum, back to the drawing board, cannot find a way around this :0(
snarf1974 is offline   Reply With Quote
Reply

Bookmarks

Tags
accordion, jquery ui

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:00 AM.


Advertisement
Log in to turn off these ads.