Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Removing horizontal scrollbars from web page using javascript

Removing horizontal scrollbars from web page using javascript

Scheduled Pinned Locked Moved Web Development
javascriptquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shrimpersfan
    wrote on last edited by
    #1

    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

    S N 2 Replies Last reply
    0
    • S Shrimpersfan

      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

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      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.'

      S 1 Reply Last reply
      0
      • S Shog9 0

        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.'

        S Offline
        S Offline
        Shrimpersfan
        wrote on last edited by
        #3

        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.

        A S J 3 Replies Last reply
        0
        • S Shrimpersfan

          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.

          A Offline
          A Offline
          acodman
          wrote on last edited by
          #4

          you can. in as much as you use a width size that is not that too wide. you can use a width of like 850px, that might do the magic for you. cheers!

          1 Reply Last reply
          0
          • S Shrimpersfan

            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.

            S Offline
            S Offline
            Shog9 0
            wrote on last edited by
            #5

            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.'

            1 Reply Last reply
            0
            • S Shrimpersfan

              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.

              J Offline
              J Offline
              JohnFernandez
              wrote on last edited by
              #6

              Try to display your code first so that we can check! :rolleyes:

              1 Reply Last reply
              0
              • S Shrimpersfan

                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

                N Offline
                N Offline
                N Surendra Prasad
                wrote on last edited by
                #7

                try this on your body onload event document.body.style.overflow='hidden'; Regards N.Surendra Prasad ;)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups