Tuesday, February 8, 2011

Mouse Scroll Wheel and IFRAME

I have an IFRAME with a vertical scroll bar on a page with a vertical scrollbar. I would like to be able to scroll the IFRAME with the scroll wheel, but in IE7 and FF3, when I click the IFRAME and scroll, both the IFRAME content and Page scrolls, not just the IFRAME. Eventually, the IFRAME is no longer under the mouse

Has anyone had to deal with this and have some ideas about what I could do?

(because I know this will come up -- I have to have the IFRAME with scrollbar and I don't control the outer page with the scrollbar)

Edit: there was a comment that it wasn't reproducible. I have divs with images in them in the IFRAME, if that makes a difference.

In this IFRAME sample site:

http://www.samisite.com/test-csb2nf/id43.htm

If you go in IE7, and use the mouse scroll, you will see that it will start to scroll the page once the IFRAME is fully scrolled. In FF3, if you move the mouse a little, it will start to have the same behavior. In mine, I get this even when the scroll isn't done or the mouse isn't moved.

I am working on a sample.

Edit: Ok, I figured it out. There was a div over the iframe that was getting the scroll events. The behavior on that IFRAME sample is also not what I was hoping for in IE7 -- so if anyone has ideas about it -- when the IFRAME is done scrolling, the page should not scroll -- it would be appreciated.

  • I am unable to duplicate the behaviour you describe in either FF3 or IE7.

    edit: They still work as expected on your example site.

    Lou Franco : wow -- really. I will try to post an example. Can you post yours?
    From ceejayoz

0 comments:

Post a Comment