Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Safari iFrame bug

Hi - I'm trying to stop an iFrame from scrolling in Safari. One would think adding 'scrolling="no"' into the tag would prohibit the content from scrolling, but if you click the mouse and drag within the non-scrolling iframe, the content scrolls.

any advice?

also - the bug is easy to see here:

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe

add scrolling="no" to the iframe tag, reload the code, and click on the content and drag, the content will scroll.

thanks
[541 byte] By [nbennett] at [2007-11-11 7:26:45]
# 1 Re: Safari iFrame bug
the general solution is to set css overflow property to hidden to prevent the scrollbar for appearing in safari

#elementId {
overflow: hidden;
/* or you can specify xy */
overflow-x: hidden;
overflow-y: hidden;
}

or in javascript (modern browsers)

var e = document.getElementById('elementId');
e.style.overflow = 'hidden';
e.style['overflow-x'] = 'hidden';
e.style['overflow-y'] = 'hidden';

hope that helps
ednark at 2007-11-11 23:35:08 >