Jump to content
Fresco

Hide scroll bar

Recommended Posts

I'm using Firefox web browser which has an add-on that lets you override whatever style you want.So my goal is to use that add-on to hide the scroll bar in the right side of the screen.There are two situations:1) The page doesn't require the scroll bar.2) The page has a scroll bar, and I want to hide it. I'm currenly using this script to hide the scroll bar, however this script works well when the page has a scroll bar.When the page doesn't have a scroll bar, the script rips off 16 pixels from the page (the default width of the scroll bar) Here's the script:

/* hide vertical scrollbar */notificationbox {	overflow-x: hidden;}browser[type="content-primary"], browser[type="content-targetable"] {	overflow-y: scroll;	margin-right: -16px; /* cut off 16 pixels no matter what*/}

Do you guys have any idea how should i check:If the page doesn't have the scroll bar, do not run the code, but if it has it, run it! Thanks in advance!

Edited by Fresco

Share this post


Link to post
Share on other sites

You are going to need to use jquery/javascript to achieve this.maybe be a away around it by changing how your page extends left to right so you dont have to use margin-right.kinda sounds like you are praticing bad CSS technique. not really sure though just guessing

Share this post


Link to post
Share on other sites

#FrescoMaybe you do not need use Jquery, just set the property on your CSS as the way: /* hide vertical scrollbar */notificationbox { overflow: hidden; overflow-x:hidden; overflow-y:auto; /*or hidden if you want*/}browser[type=content-primary], browser[type=content-targetable] { overflow: hidden; overflow-x:hidden; overflow-y:auto; /*or hidden if you want*/margin-right: -16px; /* cut off 16 pixels no matter what*/} Send one msg to us if that worth for you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...