Reputation: 11
I have a layout page which I use in every pages. Among these Cshtml pages, I need to remove scroll bar from some. I gave a code, which is working fine in google chrome, but failing in internet explorer. Can any one help me? Thanks in advance.My code is below
document.getElementsByTagName('body')[0].style = 'overflow: hidden';
Upvotes: 1
Views: 87
Reputation: 354
Microsoft has their own property for their browsers. Use this CSS property:
-ms-overflow-style: none;
Read more about it here.
Upvotes: 1
Reputation: 11354
Maybe it is the html element that is producing the scrollbar in IE. Try this:
document.getElementsByTagName('body')[0].style = 'overflow: hidden';
document.getElementsByTagName('html')[0].style = 'overflow: hidden';
I usually handle this with CSS like this:
html
{
height: 100%;
margin: 0;
padding: 0;
overflow:hidden;
}
body
{
height: 100%;
margin: 0;
overflow:hidden;
}
Upvotes: 1