PDA

View Full Version : Can I stop tabs from moving my page?



seventhfury
03-18-2008, 07:01 AM
1) Script Title: Ajax Tabs Content Script (v 2.1)

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

3) Describe problem: I got the tabs working just fine and they rock, but every time I click one my page moves up in the browser. Is there a way to make the page stay still when you click on a tab, no matter where you've scrolled on the page?

Any help would be much appreciated, here is a link to my page:
http://www.seventhfury.com/Projects/parallelstore/parallels_workstation.html

If you scroll down on the page so you're towards the bottom and click a tab, the page jumps up... it's kind of annoying and I'd like it to just stay still, is there a way to do this?

ddadmin
03-18-2008, 11:41 AM
Hmm at a glance I don't see why it should be jumping actually. One thing you can try/ should do anyways is to remove the opening and closing HEAD, BODY tags etc from each individual external page:


<html>
<head></head>

<body>

As they will result in the final page having multiples of the above tags.

seventhfury
03-18-2008, 04:12 PM
That's a great suggestion! I thought it would work, but no dice. Something else must be happening.. do you think it's due to the length of the content that I'm loading?

ddadmin
03-18-2008, 11:05 PM
Ah I think I see what's going on. It's not the length of your contents, but rather, how they differ greatly that's causing the jumping issue. For example, your first tab's content is extremely long, creating a scrollbar when loaded. When you switch to the second content that's shorter, the browser dynamically removes the unnecessary scrollbar, which in some cases makes the page jump. I'm not sure there's an easy fix for this though other than to equalize the height somewhat of your contents, as it's more of a browser behavior than anything.

seventhfury
03-18-2008, 11:20 PM
I think you're right, and it wouldn't be an easy fix. Thanks for your help, much appreciated! :D