Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pageYoffset undefined in child

    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???
    ez
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    never heard of child.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    Last edited by ez4ne12c; 04-11-2003 at 07:14 AM.
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow! my 1400 page Pure Javascript manual says IE 4+ Nav4+

    I hate it when that happens!

    Thanks Beetle.....
    ez
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •