I need to hide the horizontal scollbar on an iframe using css, jquery or js.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- how to get selected text from iframe with javascri
I'd suggest doing this with a combination of
overflow-y: hidden;
scrolling="no"
(for HTML4)and*seamless="seamless"
(for HTML5)* The
seamless
attribute has been removed from the standard, and no browsers support it.This answer is only applicable for websites which use Bootstrap. The responsive embed feature of the Bootstrap takes care of the scrollbars.
jsfiddle: http://jsfiddle.net/00qggsjj/2/
http://getbootstrap.com/components/#responsive-embed
set
scrolling="no"
attribute in your iframe.If you are allowed to change the code of the document inside your
iframe
and that content is visible only using its parent window, simply add the following CSS in youriframe
:Here a very simple example:
http://jsfiddle.net/u5gLoav9/
This solution allow you to:
Keep you HTML5 valid as it does not need
scrolling="no"
attribute on theiframe
(this attribute in HTML5 has been deprecated).Works on the majority of browsers using CSS overflow:hidden
No JS or jQuery necessary.
Notes:
To disallow scroll-bars horizontally, use this CSS instead: