1

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'; 
1

2 Answers 2

1

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; } 
Sign up to request clarification or add additional context in comments.

Comments

1

Microsoft has their own property for their browsers. Use this CSS property:

-ms-overflow-style: none; 

Read more about it here.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.