In WXP IE6, I have a button call foo():
Now the first time I push the button, the result is "document 0", next time(s) the result is the expected "documentElement 0".
So ... ? Am I dumb (probably) or what? =(
Code:
var frame = window.frames['fname'];
frame.window.scroll(0,300);
function foo () {
if (frame.window.innerHeight) {
pos = frame.window.pageYOffset
alert('window '+pos)
} else if (frame.document.documentElement
&& frame.document.documentElement.scrollTop) {
pos = frame.document.documentElement.scrollTop
alert('documentElement '+pos)
} else if (frame.document.body) {
pos = frame.document.body.scrollTop
alert('document '+pos)
}
frame.window.scroll(0,pos);
}
Now the first time I push the button, the result is "document 0", next time(s) the result is the expected "documentElement 0".
So ... ? Am I dumb (probably) or what? =(