Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
BSaunders

Hide scrollbar?

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Any way to hide the browser scrollbar on draggable?  It looks like the system adds an inline style attribute, so using css is (slightly) more difficult.

Link to comment
Share on other sites

  • 8 months later...

Using TweenMax.set(".scrollbox", { overflow: 'hidden' }) disables scrolling with a mouse wheel (I'm using a scroll event listener). Any suggestions would be appreciated. Thanks.

Link to comment
Share on other sites

One problem with that is that it doesn't seem to work for touch. 

 

You can push them out of view...

See the Pen EjbXda by osublake (@osublake) on CodePen

 

If you know the height of the container, you can hide them with nesting.

http://jsfiddle.net/OSUblake/q6kqdroq/1/

 

Not sure if other browsers support this yet, but you can hide them with css in webkit.

::-webkit-scrollbar {
  display: none;
}
  • Like 2
Link to comment
Share on other sites

Thanks. I'm going keep the mousewheel event handler in mind for future projects...had used similar code in Silverlight mapping projects, but kinda forgot about it for HTML5. (Duh). For simplicity's sake, since my DIVs are absolutely positioned, I'm just using margin-right: -20px. But will probably use the code in OSUblake's "push them out of view" example since scroll bars vary in width (i.e. desktop vs. iOS).

Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×