PDA

View Full Version : Ajax Tabs link from bottom of page



littlericky
08-06-2008, 01:18 PM
1) Script Title: Ajax Tabs Content Script (v 2.2)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem: I'm using a div at the top of the page which is being loaded from a list of links at the bottom of the page ie:
<li><a href="external.htm" rel="countrycontainer">Tab 2</a></li>

The problem is that since this is a list of approx 20 links the top div is not visible on the page. Is there some way to ref an anchor to shift the page up upon loading the div?
Thanks

ddadmin
08-06-2008, 08:07 PM
You can try adding inside the tab in question, specifically, its LI element, a code such as:


<li><a href="#" class="selected" rel="#default">Tab 1</a></li>
<li onClick="this.scrollIntoView()"><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="external3.htm" rel="countrycontainer">Tab 3</a></li>

This theoretically should cause the page to jump back to the top of the tab when clicked on. If that doesn't work, it may be because of the (long) delay before your Ajax content is fetched, causing the page's height to change only after the browser has already jumped to the top of the tab, throwing things off again. If so, you can try something else, but let me know if this works first.