Iframe always showing scroll bars in IE7

非 Y 不嫁゛ 提交于 2019-11-29 12:58:12

问题


Having an annoying issue in IE7. I have a website where, at the bottom of every page theres an Iframe, and for the life of me I cannot get the scroll bars to hide. This is only in IE7, every other browser I have tested is fine.

I have scrolling="no" and set overflow:hidden; still not working though.

If anyones got anything they could suggest I'd be very greatful

http://www.keyscape.co.uk is the site

Cheers Martin


回答1:


adding scroll="no" to the body of my iframe target page worked for me. In total, here's the additional cruft I've added to my iframe for various browsers, perhaps this will help someone else:

iFrame source HTML:

<body style="overflow:hidden;" scroll="no">

iFrame tag on page:

<iframe width="280" height="196" src="http://dev.example.com/source.html"
style="overflow:hidden;" marginheight="0" marginwidth="0" frameborder="0">
</iframe>



回答2:


Try setting the BODY tag of the IFRAME content to <BODY scroll="no"> and add the following CSS the content's page:

html 
{ 
     overflow:hidden; 
}



回答3:


By using jQuery from parent page

<script type="text/javascript">
$('#iframeid').contents().find('body').css('overflow', 'hidden');
$('#iframeid').contents().find('body').attr('scrolling', 'No');
</script>

Use this, it should work.



来源:https://stackoverflow.com/questions/2898403/iframe-always-showing-scroll-bars-in-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!