views:

580

answers:

3

I code this page, a tab with sliding capability : here I really like the effect, but when you vien a long tab (let say specification), and we go to a smalll one (download) reclicking on a large one force the user to scroll down again...

Is it possible to jquery something that tell the page to stay scroll down at the max after the tab pressed ?

+1  A: 

Yes. OnLoad you could iterate through all the tabs, find the tallest and set the container's height to that value and remove whatever's doing the smooth resizing.

It means some of the smaller things might look a little lost, but you'd not be resizing the page (which annoys me too).

Oli
the resizing is the thing a like, manually scrooling is the thing i like to get rid of!
marc-andre menard
You could go halfway. Instead of stopping all vertical resizing, you could run a check on the item you're switching to. If it's taller, resize; else, don't.
Oli
+1  A: 

I'm doing something like this with the jQuery UI tabs, you can modify it for whatever layout:

//Tab panel height matching
$(".ui-tabs-panel").each(function() {
if ($(this).height() + 30 > $(this).parents(".subTabsC").height()) {
  $(this).parents(".subTabsC").height($(this).height() + 30);
}
});

I have the whole tab content wrapped in a <div class="subTabsC">. The 30 pixels in my case is to account for the tabs and the border, adjust to whatever you need.

Nick Craver
A: 

couldn't you just add "return false" at the end of your function? this would prevent it from "refreshing" the page when you click the anchor link....I could be wrong...I'm just starting to learn jquery and javascript.

jeff z