Fresco Posted July 25, 2012 Share Posted July 25, 2012 (edited) 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 July 25, 2012 by Fresco Link to comment Share on other sites More sharing options...
Shadowing Posted July 27, 2012 Share Posted July 27, 2012 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 Link to comment Share on other sites More sharing options...
softdoni Posted July 30, 2012 Share Posted July 30, 2012 #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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now