Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added margin and padding support + mirrorring #381

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ When you call "niceScroll" you can pass some parameters to custom visual aspects
- bouncescroll, enable scroll bouncing at the end of content as mobile-like (only hw accell) (default:false)
- spacebarenabled, enable page down scrolling when space bar has pressed (default:true)
- railpadding, set padding for rail bar (default:{top:0,right:0,left:0,bottom:0})
- railmargin, set margin for rail bar (default:{top:0,right:0,left:0,bottom:0})
- railhpadding, set padding for hrail bar (default:{top:-1,right:-1,left:-1,bottom:-1}), if no specific railhpadding is set it'll mirror the settings from rail bar when mirrorrails is set to true
- railhmargin, set margin for hrail bar (default:{top:-1,right:-1,left:-1,bottom:-1}), if no specific railhmargin is set it'll mirror the settings from rail bar when mirrorrails is set to true
- mirrorrails, if no specific railhmargin/railhpadding is set it'll mirror the settings from rail bar (default:true)
- disableoutline, for chrome browser, disable outline (orange hightlight) when selecting a div with nicescroll (default:true)
- horizrailenabled, nicescroll can manage horizontal scroll (default:true)
- railalign, alignment of vertical rail (defaul:"right")
Expand Down
6 changes: 5 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
<script>
$(document).ready(function() {

var nice = $("html").niceScroll(); // The document page (body)
var nice = $("html").niceScroll({
//mirrorrails:true,
railmargin:{left:10,right:10,top:10,bottom:10},
railpadding:{left:0,right:20,top:10,bottom:40}
}); // The document page (body)

$("#div1").html($("#div1").html()+' '+nice.version);

Expand Down
Loading