scrollTop in an <IFRAME> not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Axel Schick

    #1

    scrollTop in an <IFRAME> not working

    Hello everybody!

    I encountered a strange behavior when trying to read the scrollTop
    propery of the <body> element from inside an iFrame:

    <body onmousemove = "window.sta tus = document.body.s crollTop;">

    allways reports "0" , even if i scroll down in the iframe.

    Is this a known bug?

    Thanx, Axel
  • Martin Honnen

    #2
    Re: scrollTop in an &lt;IFRAME&g t; not working



    Axel Schick wrote:

    [color=blue]
    > I encountered a strange behavior when trying to read the scrollTop
    > propery of the <body> element from inside an iFrame:
    >
    > <body onmousemove = "window.sta tus = document.body.s crollTop;">
    >
    > allways reports "0" , even if i scroll down in the iframe.
    >
    > Is this a known bug?[/color]

    Whether body.scrollTop says anything about the scroll position depends
    on the browser and with IE 6/Win even on the rendering mode so at least
    tell us what browser you are trying with and give a URL perhaps.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • seven

      #3
      Re: scrollTop in an &lt;IFRAME&g t; not working

      Martin Honnen <mahotrash@yaho o.de> wrote in message news:<41f7c64e$ 0$17620$9b4e6d9 3@newsread4.arc or-online.net>...[color=blue]
      > Axel Schick wrote:
      >
      >[color=green]
      > > I encountered a strange behavior when trying to read the scrollTop
      > > propery of the <body> element from inside an iFrame:
      > >
      > > <body onmousemove = "window.sta tus = document.body.s crollTop;">
      > >
      > > allways reports "0" , even if i scroll down in the iframe.
      > >
      > > Is this a known bug?[/color]
      > Whether body.scrollTop says anything about the scroll position depends
      > on the browser and with IE 6/Win even on the rendering mode so at least
      > tell us what browser you are trying with and give a URL perhaps.[/color]


      Yes, that's true,sorry. We use IE6 for our ERP-System. I've set up a
      Testpage in which i stripped the code to the bone, so i could
      reproduce the behavior and guess what? It works... so i searched a bit
      more and found that the page, where i want to implement the feature,
      uses a HTC behaviour which alternates the properties of the body tag..
      Sorry I could not give you an URL, because the Page runs in our
      Intranet, but if i figure anything out, that causes the problem i will
      post it...

      Cheers, Axel

      Comment

      Working...