user285594
user285594

Reputation:

Why iframe does not hide its scrollbar?

Google Chrome or Chromium (latest/stable version).

enter image description here

enter image description here

When i have an iframe with following

<style>
iframe{
  overflow:hidden;
}
iframe::-webkit-scrollbar {
  display: none; 
}
</style>

 <iframe
  src="images/tion.pdf#scrollbar=0&scrolling=0&page=1&zoom=50&scrollbar=0&toolbar=0&navpanes=0" 
  width="410px" 
  height="570px" 
  id='myiframe' 
  style='border:none;' 
  scrolling="no"></iframe>

It seems like it is impossible to hide the scrollbar horizontally or vertically when the PDF file is containing more then 1 page?

I have tried all the related answers from stackoverflow but none of them is resolving it.

But when i use the same code in OSX with Google chrome or OSX or on Linux it works. It is not working when i use Windows and Google chrome/Chromium.

Is this unknown missed out BUG or iframe was designed like this for windows , when there is a PDF you cant remove the scrollbar's?

Upvotes: 2

Views: 308

Answers (2)

Ujjwal Kumar Gupta
Ujjwal Kumar Gupta

Reputation: 2376

The tag which is overflowing inside the iframe, add css {overflow:hidden} to that tag.It might work

Upvotes: 0

Krishna Patel
Krishna Patel

Reputation: 275

Try to set width and height like this:

<iframe name="right_side" src="" width="50%" height="50%" ></iframe>

hope it will help you!

Upvotes: 1

Related Questions