Reputation: 2541
When I use tabs in jQuery UI with simple template like this:
<div id="products-tabs">
<ul>
<li><a href="#product-1">Product 1</a></li>
<li><a href="#product-2">Product 2</a></li>
</ul>
<div id="product-1">
Product 1
</div>
<div id="product-2">
Product 2
</div>
</div>
JS:
$('#products-tabs').tabs();
Then everything works fine. But I want to add effect of different swaping between tabs. For example like this:
$('#products-tabs').tabs({
show: { effect: "fadeIn", duration: 800 }
});
It works, but when I have the tabs at the bottom of the page, then when I click on one of the tabs the position of the window resets back to top. How can I prevent it?
Fiddle here: http://jsfiddle.net/46a8y/3/ (just scroll to the bottom in output window to see what I mean)
Upvotes: 0
Views: 79
Reputation: 3212
Wrap your tabs div inside another fixed-height div:
<div id="wrapper">your tabs</div>
Upvotes: 1
Reputation: 4482
after a tab is activated you can call an callback to jump to the bottom of your page?
activate: function(){
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
}
like this: http://jsfiddle.net/46a8y/4/
Upvotes: 1