Why doesnt this work in Opera ?

J

JezB

I have some javascript to restore the scroll position of a DIV over
postbacks. I've tested it on all major browsers and the only one it doesn't
work on is Opera. Could someone tell me why, and what I can do to (a) test
that it's Opera that's running and (b) how to get and set the scroll
position - scrollTop does not seem to work.

Here's the code :

// scrolls the "what" element given to it (the DIV scroll area)
// call from body onload (ie. on every postback)
function ScrollIt(what){
document.getElementById(what).scrollTop =
document.Form1.ScrollPos.value;
}

// saves the DIV scroll position (call from onscroll on the DIV)
function setdiv(val) {
document.Form1.ScrollPos.value = val.scrollTop;
}

I save the scroll position in a hidden field "ScrollPos" :

<input id="ScrollPos" type="hidden" value="0" name="ScrollPos"
runat="server">
 
C

Curt_C [MVP]

this is all clientside code. Perhaps you should hit up a clientside group,
or even a Opera specific one out there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top