View Full Version : Page pops to the top

Mar 13th, 2008, 08:38 PM
I've created a dynamic element that is rendered visible when a link is clicked. This all works perfectly when my browser window is maximized. If I "restore down" (reduce my browser window size) and then click on the link, the element renders, but the browser pops the window back up to the top and buries the link and the newly-rendered element so the user has to scroll down to view it. The same think occurs when I render the element invisible. I can't figure out what's causing this or how to fix it. Any suggestions?

Mar 13th, 2008, 09:00 PM
What's the href of the link?

Mar 13th, 2008, 09:22 PM
<a href=# onclick="renderElem(event, 'e1')">

Mar 14th, 2008, 01:53 AM
<a href=# onclick="renderElem(event, 'e1')">

Mar 14th, 2008, 06:50 AM

<a href="javascript:void(renderElem(event, 'e1'))">

a concern here though, why are you passing the element event? it's not defined in firefox/opera (maybe)/safari, etc. it's proprietary msie. if you switch the parameters on your function and omit event from the call, event will still work normally (as window.event) and you'll get the Moz implementation of the implicit additional parameter e, passed in on whatever name you were accepting the event object on, also you should make certain that your event is being processed correctly if you're getting the source elements or anything, especially since the msie event object won't be bound in anymore.... something to think about.