javascript - IE9 ignoring scrolling and overflow attributes -


my page loaded iframe, , need adapt size of iframe using javascript. try following:

iframe.style.overflow = 'hidden' iframe.scrolling = 'no' var content = iframe.contentwindow.document.getelementbyid('content') var height = content.offsetheight + 10 iframe.style.height = height + 'px' console.log(content.offsetwidth) var width = content.offsetwidth + 10 iframe.style.width = width + 'px' 

on firefox works supposed to, ie9 ignores both scrolling , overflow attributes. browser mode set ie9-standards.

how rid of scroll in iframe under ie9?

looks iframe loaded, when you're doing this. can set:

iframe.contentwindow.document.body.style.overflow = 'hidden'; 

if there's literal iframe tag on page, can set scrolling attribute "no", when setting attribute value js after iframe element has been created page, doesn't work. if you're creating iframe dynamically, can set setattribute('scrolling', 'no') before appending document.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -