Removing horizontal scrollbars from web page using javascript
-
Hi there. I currently have a website and on a couple of my pages there are horizontal toolbars that I wish to remove. I'm pretty sure that there is a way of removing these but am not sure how. Just wondering if anyone had any ideas? David
-
Hi there. I currently have a website and on a couple of my pages there are horizontal toolbars that I wish to remove. I'm pretty sure that there is a way of removing these but am not sure how. Just wondering if anyone had any ideas? David
Reduce the width of your page, and the browser won't show scrollbars. If you want to hide scrollbars, check out the CSS
overflow
attribute... but your page will still be too wide, and now users won't be able to scroll to see it (well, not with scrollbars at any rate).Citizen 20.1.01
'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
-
Reduce the width of your page, and the browser won't show scrollbars. If you want to hide scrollbars, check out the CSS
overflow
attribute... but your page will still be too wide, and now users won't be able to scroll to see it (well, not with scrollbars at any rate).Citizen 20.1.01
'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
can i reduce the width of my page within the script? I have even opened the page in MS Visual Web Developer and reduced the width of all paragraphs, images etc. But still no good.
-
can i reduce the width of my page within the script? I have even opened the page in MS Visual Web Developer and reduced the width of all paragraphs, images etc. But still no good.
-
can i reduce the width of my page within the script? I have even opened the page in MS Visual Web Developer and reduced the width of all paragraphs, images etc. But still no good.
Brother, you may need to spend more time with your HTML reference. There are a lot of ways you can (intentionally or otherwise) force your page to be wider than it needs to be - large images, and absolute widths on tables or other elements are common - but potentially there are more subtle factors at play here (for instance, a table with two columns, each sized to 50%, may become wider than the viewport if there are borders, margins, or rounding errors in the browser itself). The use of an editing tool such as VWD can make these even more difficult to track down by obfuscating the actual styles in effect. I recommend simplifying the page HTML as much as possible, to help make the source of the problem more obvious. Also, consider installing the Firebug tool for Firefox - it lets you visually examine the calculated dimensions of each element on the page, and by drilling down with this tool in hand you may be able to more quickly determine all that has contributed to your current predicament.
Citizen 20.1.01
'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
-
can i reduce the width of my page within the script? I have even opened the page in MS Visual Web Developer and reduced the width of all paragraphs, images etc. But still no good.
Try to display your code first so that we can check! :rolleyes:
-
Hi there. I currently have a website and on a couple of my pages there are horizontal toolbars that I wish to remove. I'm pretty sure that there is a way of removing these but am not sure how. Just wondering if anyone had any ideas? David
try this on your body onload event document.body.style.overflow='hidden'; Regards N.Surendra Prasad ;)