PDA

View Full Version : Page location jump when clicking tabs



masey
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...

jscheuer1
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:


.contentstyle{
width: 530px;
margin-bottom: 1em;
height:500px;
}


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.

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

jscheuer1
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:


min-height:450px;
height:auto!important;
height:450px;