View Full Version : Page location jump when clicking tabs

03-02-2007, 07:33 PM
1) Script Title: Ajax Tabs Content script

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

3) Describe problem:

RE: http://www.equinox.ca/CathayUSAv5/new_product/index.htm

My tabbed content is about a half way down the page and beyond the "first fold". When I click on different tabs, the new content loads in the right new tabs, but the page always returns to the top forcing you to have to scroll back down to the tabbed content each time. This is annoying to say the least.

Is there any way of preventing this that people know of?

Thanks in advance...

03-02-2007, 09:07 PM
Your problem is that the height of the page is changing. If you give the content display area a height that is as high as the highest content that will be displayed in it:

width: 530px;
margin-bottom: 1em;

that should take care of it. I just guessed at 500px, seemed about right. Experiment, it may need to be a little more than that.

03-02-2007, 09:24 PM
That's a pretty clunky hack, but thanks for the help... I appreciate it!

03-02-2007, 09:34 PM
Clunky hack? Well a hack usually applies to only one browser but, I get your drift. However, I don't see what is so clunky about it. Let's say you had other content below that. To prevent that from jumping around, you would need something similar. If a certain amount of jumpiness is OK or even desirable, you could use a min-height but, that does require a hack to work in IE 6 and earlier: