0

I came across this site Teehan and Lax (http://www.teehanlax.com/) and saw that when you click on the top menu, a set of links dropsdown. The containing div is set to

#main-nav-drop{
    position:fixed;
    overflow-y:scroll;
}

However, when scrolling, the actual window scrollbar is hidden, both on desktop and mobile. How is this being done?

1 Answer 1

1

On that site it is done by adding padding-right: 100px; to nav element.

Sign up to request clarification or add additional context in comments.

2 Comments

Interesting solution. Are there any other ways to do this? I'm working on an off-canvas slideout responsive menu and need the menu to be scrollable. I'm looking into Overflow.js, but would like to remove the scrollbar that appears so it seems more native-like.
You can set overflow:hidden, track mousewheel event, and change scrollTop property by scroll delta. github.com/brandonaaron/jquery-mousewheel might be helpful. Which solution is more likely i'm not sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.