ez4ne12c
04-11-2003, 01:38 AM
Hi,
i have opened a child window and am trying to display the
pageYOffset like this
child.document.write('the offset is '+child.pageYOffset);
i keep getting undefined
as the result...
any idea why???
:confused: ez
ez4ne12c
04-11-2003, 07:05 AM
apologies if that wasnt too clear :(
oh well what i mean is child where child is any child window
in this case i open a window from the main page called search, so im saying that this is a child window
here are the attribs of search
var pop_search="width=400,height=480,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,directories=no,location=no, menubar=no,status=no";
var search = window.open('','search_window',pop_search);
so then i do
search.document.write('the offset is '+search.pageYOffset);
in other words im trying to display the pageYoffset in the child window named search and i keep getting undefined no matter how much stuff is on the page
i have also tried
search.document.write ("<script>document.write(pageYOffset)<\/script>");
still undefined...
any ideas?
ez
:confused:
beetle
04-11-2003, 07:50 AM
pageYOffset is NS-only, isn't it?
You need document.body.scrollTop for IE (unless you've got IE6 and an XHTML doctype, in which case you'd want document.documentElement.scrollTop)
ez4ne12c
04-14-2003, 12:19 AM
Wow! :eek: my 1400 page Pure Javascript manual says IE 4+ Nav4+
I hate it when that happens!:mad:
Thanks Beetle.....
ez :D