PDA

View Full Version : Page pops to the top



zcountezza
Mar 13th, 2008, 07: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?

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

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

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

mjlorbet
Mar 14th, 2008, 05:50 AM
try

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