View Full Version : Page scroll to top when I click on any tab

02-09-2007, 04:49 PM
1) Script Title: Ajax Tabs Content script

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

3) Describe problem:
For some reason, when i incorporate the code into my webpage, the screen scrolls to the bottom if i position the tab menu up on the top of the screen. But it is not the case if i position the tab menu down near the bottom of the screen, the page doesnt move and behave exactly as in the demo.

The scrolling when the menu tab is on the top of the screen seems to try to position the tab menu in the middle of the screen. Is this expected behaviour or bug?

Thank you.

02-09-2007, 05:16 PM
Neither, I would expect. Does this happen on the demo page here at DD? Is there anything in your loaded content that might be causing this? How about a link to your problem page?

02-09-2007, 06:03 PM

So to replicate the problem, you need to let the tab menu closer to the top of your browser. When you click on the tab, it will reposition the page (as if the page refresh) so that the tab is somewhat lower in the screen.

Thanks for looking into this, John.

02-09-2007, 06:12 PM
One more thing that i notice.. if you dont maximize your browser screen, the problem is gone. This happens in my browser (IE 6 and Firefox) when the browser is set to maximize.

02-09-2007, 06:12 PM
I think that if you assigned a fixed height to the content area, that effect could be avoided. Also, if the content area did not span the entire width of the page, that might be all that would be required to stop the effect. It really isn't so much that the page is scrolling as it is that the page's height is changing.

02-09-2007, 08:15 PM
Thanks John! You're a genius!