Skip to content
Merged
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ Demo and more: http://rocha.la/jQuery-slimScroll
Copyright (c) 2011 Piotr Rochala (http://rocha.la)
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.

added option over librarry of rochal
jQuery('#scroll').slimScroll({
height: jQuery(window).height()+'px', //if you want whole page containing div to get scroll it's a trick only
mouseOver:true // if element you want to scroll will already hovered then make it true else no need to mention it.
});
18 changes: 18 additions & 0 deletions jquery.slimscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
// sets rail color
railColor : '#333',

//if already mouse is there
mouseOver:false,

// sets animation status on a given scroll
animate: false,

// sets rail opacity
railOpacity : .2,

Expand Down Expand Up @@ -333,6 +339,18 @@
if (!releaseScroll) { e.returnValue = false; }
}

//if element is allready hovered
if(o.mouseOver){
rail.trigger('hover')
}

// scroll content
if (o.animate){
me.animate({ scrollTop: delta });
}else{
me.scrollTop(delta);
}

function scrollContent(y, isWheel, isJump)
{
releaseScroll = false;
Expand Down
17 changes: 1 addition & 16 deletions jquery.slimscroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.