HTML iframe - disable scroll
Unfortunately I do not believe it's possible in fully-conforming HTML5 with just HTML and CSS properties. Fortunately however, most browsers do still support the scrolling
property (which was removed from the HTML5 specification).
overflow
isn't a solution for HTML5 as the only modern browser which wrongly supports this is Firefox.
A current solution would be to combine the two:
<iframe src="" scrolling="no"></iframe>
iframe {
overflow: hidden;
}
But this could be rendered obsolete as browsers update. You may want to check this for a JavaScript solution: http://www.christersvensson.com/html-tool/iframe.htm
Edit: I've checked and scrolling="no"
will work in IE10, Chrome 25 and Opera 12.12.
Disabling/Hiding iframe Scroll bar?
There are many ways for this.
add scrolling="no"
in the iframe tag and style="border:0;"
<figure><iframe width="1350" height="120" scrolling="no" style="border:0;" src="//laut.fm/widgets/player_for/radio-am-bad-2?player%5Bstations%5D=radio-am-bad-2&player%5Bcolor%5D%5Bcolor%5D=white&player%5Bshadow%5D=false&player%5Bdisplay%5D%5Bborder%5D%5Bradius%5D=60px&player%5Bcolor%5D%5Bbackground_to%5D=%23ff00ff&player%5Bcolor%5D%5Bbackground_from%5D=%2300ff84&player%5Bborder%5D%5Bcolor%5D=%23cccccc&player%5Bborder%5D%5Bwidth%5D=0px&player%5Bbutton%5D%5Bcolor%5D%5Bbackground_to%5D=%23000000&player%5Bbutton%5D%5Bcolor%5D%5Bbackground_from%5D=%23000000&player%5Bbutton%5D%5Bborder%5D%5Bcolor%5D=%23333333&player%5Bbutton%5D%5Bborder%5D%5Bw[enter image description here][1]idth%5D=2px"></iframe></figure>
Remove scrollbar from iframe
in your css:
iframe{
overflow:hidden;
}
Disable scroll in Iframe
in your css:
iframe{
overflow:hidden;
}
set iframe as :
<iframe src="http://bing.com" class="foo" scrolling="no" seamless="seamless"></iframe>
scrolling="no"
seamless="seamless"
disable scroll on iframe until clicked on?
If your iframe is a fixed size, follow it immediately with a clickable link that fits the size of the iframe, but doesn't contain anything. Give it a negative top margin, so it moves up over top of the iframe. Then hide it once it's been clicked upon.
HTML:
<a id='clearBox' href='javascript:removeClearBox()'> </a>
Javascript:
function removeClearBox() {
$('#clearBox').addClass('hidden');
}
CSS:
#clearBox {
width: [iframe width]px;
height: [iframe height]px;
display: block;
margin-top: -[iframe height]px;
text-decoration: none;
}
/*in case you don't have a .hidden class:*/
.hidden { display: none; }
You may also need to play with z-index
, depending on what's in the iframe, but that's easy enough to figure out.
Your stylings may vary, and it may also be possible to use dynamic sizing with more javascript.
How to remove scrolling iframe. Tried known solutions
It seems that the scroll isn't on the iframe
, it is on the body
of the iframe
. I was playing around with the Google Developer tools, and found that if you add overflow: hidden;
to your iframe
, it doesn't work. You'll have to go to the page that is being represented in the iframe
and add this style
to the body
of that page:
body {
overflow: hidden;
/* Other code */
}
Related Topics
With Ng-Bind-Html-Unsafe Removed, How to Inject Html
What Is Sr-Only in Bootstrap 3
Equal Height Rows in a Flex Container
Is Either Get or Post More Secure Than the Other
Change Select List Option Background Colour on Hover
Centered Elements Inside a Flex Container Are Growing and Overflowing Beyond Top
Is It Valid to Have a HTML Form Inside Another HTML Form
I Need an Unordered List Without Any Bullets
Difference Between Id and Class in Css, and When Should I Use Them
Are Custom Elements Valid Html5
Font Awesome 5 on Pseudo Elements Shows Square Instead of Icon
Set the Table Column Width Constant Regardless of the Amount of Text in Its Cells
Nesting Block Level Elements Inside the ≪P≫ Tag... Right or Wrong
Make a Grid Item Span to the Last Row/Column in Implicit Grid
Keep the Middle Item Centered When Side Items Have Different Widths