
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam rhoncus, felis interdum condimentum consectetur, nisl libero elementum eros, vehicula congue lacus eros non diam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus mauris lorem, lacinia id tempus non, imperdiet et leo. Cras sit amet erat sit amet lacus egestas placerat. Aenean ultricies ultrices mauris ac congue. In vel tortor vel velit tristique tempus ac id nisi. Proin quis lorem velit. Nunc dui dui, blandit a ullamcorper vitae, congue fringilla lectus. Aliquam ultricies malesuada feugiat. Vestibulum placerat turpis et eros lobortis vel semper sapien pulvinar.
Pellentesque rhoncus aliquet porta. Sed vel magna eu turpis pharetra consequat ut vitae lectus. In molestie sollicitudin mi sit amet convallis. Aliquam erat volutpat. Nullam feugiat placerat ipsum eget malesuada. Nulla facilisis nunc non dolor vehicula pretium. Sed dui magna, sodales id pharetra non, ullamcorper eu sapien. Mauris ac consectetur leo. Mauris consequat, lectus ut bibendum pulvinar, leo magna feugiat enim, eu commodo lacus sem vel ante. Sed tempus metus eget leo mollis vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed pulvinar rhoncus quam, vel semper tellus viverra id. Nulla rutrum porttitor odio, a rutrum purus gravida non. Etiam ac purus augue, eget vestibulum purus. Aenean venenatis ullamcorper augue, non consequat elit tempor sed. Donec velit sapien, volutpat sed ultricies egestas, semper a ante. Fusce dapibus, quam eget auctor suscipit, nibh leo posuere ante, at auctor nisi lacus in sem. Morbi interdum consectetur euismod. Cras accumsan est lacus. Nulla eleifend, eros vel consequat commodo, arcu nunc malesuada nunc, quis sagittis felis sem ac turpis.
Nulla rhoncus elementum convallis. Mauris condimentum aliquet egestas. Ut iaculis nisi eget tellus accumsan venenatis. Maecenas imperdiet aliquam porta. Aenean ultrices dolor sed quam laoreet varius. Curabitur condimentum blandit erat, quis accumsan eros interdum vitae. Curabitur ligula arcu, sollicitudin vitae iaculis sed, blandit sit amet enim. Morbi ullamcorper, metus vel mollis tristique, arcu turpis malesuada nisi, at dignissim lorem odio a orci. Proin ultrices, ipsum ut vestibulum interdum, libero felis auctor mi, vitae convallis nisl justo ac tellus. Integer nec lacinia turpis. Etiam massa nisl, rhoncus quis rutrum in, pretium eu leo. Proin a velit ut nulla laoreet vestibulum. Curabitur eu elit vitae felis auctor tincidunt. Curabitur tincidunt, metus sed sollicitudin cursus, quam elit commodo erat, ut tempor erat sapien vitae velit. Morbi nec viverra erat.
Nullam scelerisque facilisis pretium. Vivamus lectus leo, commodo ac sagittis ac, dictum a mi. Donec quis massa ut libero malesuada commodo in et risus. Fusce nunc dolor, aliquet vel rutrum in, molestie sit amet massa. Aliquam suscipit, justo a commodo condimentum, enim sapien fringilla ante, sed lobortis orci lectus in ante. Donec vel interdum est. Donec placerat cursus lacus, eu ultricies nisl tincidunt a. Fusce libero risus, sagittis eleifend iaculis aliquet, condimentum vitae diam. Suspendisse potenti. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin leo purus, sodales a venenatis luctus, faucibus ac enim. Sed id metus ac sem lobortis pretium. Mauris faucibus tempor scelerisque. Nunc vulputate interdum tortor, non tincidunt dui condimentum eget. Aenean in porttitor velit. Nam accumsan rhoncus risus id consectetur.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam rhoncus, felis interdum condimentum consectetur, nisl libero elementum eros, vehicula congue lacus eros non diam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus mauris lorem, lacinia id tempus non, imperdiet et leo. Cras sit amet erat sit amet lacus egestas placerat. Aenean ultricies ultrices mauris ac congue. In vel tortor vel velit tristique tempus ac id nisi. Proin quis lorem velit. Nunc dui dui, blandit a ullamcorper vitae, congue fringilla lectus. Aliquam ultricies malesuada feugiat. Vestibulum placerat turpis et eros lobortis vel semper sapien pulvinar.
Pellentesque rhoncus aliquet porta. Sed vel magna eu turpis pharetra consequat ut vitae lectus. In molestie sollicitudin mi sit amet convallis. Aliquam erat volutpat. Nullam feugiat placerat ipsum eget malesuada. Nulla facilisis nunc non dolor vehicula pretium. Sed dui magna, sodales id pharetra non, ullamcorper eu sapien. Mauris ac consectetur leo. Mauris consequat, lectus ut bibendum pulvinar, leo magna feugiat enim, eu commodo lacus sem vel ante. Sed tempus metus eget leo mollis vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed pulvinar rhoncus quam, vel semper tellus viverra id. Nulla rutrum porttitor odio, a rutrum purus gravida non. Etiam ac purus augue, eget vestibulum purus. Aenean venenatis ullamcorper augue, non consequat elit tempor sed. Donec velit sapien, volutpat sed ultricies egestas, semper a ante. Fusce dapibus, quam eget auctor suscipit, nibh leo posuere ante, at auctor nisi lacus in sem. Morbi interdum consectetur euismod. Cras accumsan est lacus. Nulla eleifend, eros vel consequat commodo, arcu nunc malesuada nunc, quis sagittis felis sem ac turpis.
Nulla rhoncus elementum convallis. Mauris condimentum aliquet egestas. Ut iaculis nisi eget tellus accumsan venenatis. Maecenas imperdiet aliquam porta. Aenean ultrices dolor sed quam laoreet varius. Curabitur condimentum blandit erat, quis accumsan eros interdum vitae. Curabitur ligula arcu, sollicitudin vitae iaculis sed, blandit sit amet enim. Morbi ullamcorper, metus vel mollis tristique, arcu turpis malesuada nisi, at dignissim lorem odio a orci. Proin ultrices, ipsum ut vestibulum interdum, libero felis auctor mi, vitae convallis nisl justo ac tellus. Integer nec lacinia turpis. Etiam massa nisl, rhoncus quis rutrum in, pretium eu leo. Proin a velit ut nulla laoreet vestibulum. Curabitur eu elit vitae felis auctor tincidunt. Curabitur tincidunt, metus sed sollicitudin cursus, quam elit commodo erat, ut tempor erat sapien vitae velit. Morbi nec viverra erat.
Nullam scelerisque facilisis pretium. Vivamus lectus leo, commodo ac sagittis ac, dictum a mi. Donec quis massa ut libero malesuada commodo in et risus. Fusce nunc dolor, aliquet vel rutrum in, molestie sit amet massa. Aliquam suscipit, justo a commodo condimentum, enim sapien fringilla ante, sed lobortis orci lectus in ante. Donec vel interdum est. Donec placerat cursus lacus, eu ultricies nisl tincidunt a. Fusce libero risus, sagittis eleifend iaculis aliquet, condimentum vitae diam. Suspendisse potenti. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin leo purus, sodales a venenatis luctus, faucibus ac enim. Sed id metus ac sem lobortis pretium. Mauris faucibus tempor scelerisque. Nunc vulputate interdum tortor, non tincidunt dui condimentum eget. Aenean in porttitor velit. Nam accumsan rhoncus risus id consectetur.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam rhoncus, felis interdum condimentum consectetur, nisl libero elementum eros, vehicula congue lacus eros non diam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus mauris lorem, lacinia id tempus non, imperdiet et leo. Cras sit amet erat sit amet lacus egestas placerat. Aenean ultricies ultrices mauris ac congue. In vel tortor vel velit tristique tempus ac id nisi. Proin quis lorem velit. Nunc dui dui, blandit a ullamcorper vitae, congue fringilla lectus. Aliquam ultricies malesuada feugiat. Vestibulum placerat turpis et eros lobortis vel semper sapien pulvinar.
Pellentesque rhoncus aliquet porta. Sed vel magna eu turpis pharetra consequat ut vitae lectus. In molestie sollicitudin mi sit amet convallis. Aliquam erat volutpat. Nullam feugiat placerat ipsum eget malesuada. Nulla facilisis nunc non dolor vehicula pretium. Sed dui magna, sodales id pharetra non, ullamcorper eu sapien. Mauris ac consectetur leo. Mauris consequat, lectus ut bibendum pulvinar, leo magna feugiat enim, eu commodo lacus sem vel ante. Sed tempus metus eget leo mollis vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed pulvinar rhoncus quam, vel semper tellus viverra id. Nulla rutrum porttitor odio, a rutrum purus gravida non. Etiam ac purus augue, eget vestibulum purus. Aenean venenatis ullamcorper augue, non consequat elit tempor sed. Donec velit sapien, volutpat sed ultricies egestas, semper a ante. Fusce dapibus, quam eget auctor suscipit, nibh leo posuere ante, at auctor nisi lacus in sem. Morbi interdum consectetur euismod. Cras accumsan est lacus. Nulla eleifend, eros vel consequat commodo, arcu nunc malesuada nunc, quis sagittis felis sem ac turpis.
Nulla rhoncus elementum convallis. Mauris condimentum aliquet egestas. Ut iaculis nisi eget tellus accumsan venenatis. Maecenas imperdiet aliquam porta. Aenean ultrices dolor sed quam laoreet varius. Curabitur condimentum blandit erat, quis accumsan eros interdum vitae. Curabitur ligula arcu, sollicitudin vitae iaculis sed, blandit sit amet enim. Morbi ullamcorper, metus vel mollis tristique, arcu turpis malesuada nisi, at dignissim lorem odio a orci. Proin ultrices, ipsum ut vestibulum interdum, libero felis auctor mi, vitae convallis nisl justo ac tellus. Integer nec lacinia turpis. Etiam massa nisl, rhoncus quis rutrum in, pretium eu leo. Proin a velit ut nulla laoreet vestibulum. Curabitur eu elit vitae felis auctor tincidunt. Curabitur tincidunt, metus sed sollicitudin cursus, quam elit commodo erat, ut tempor erat sapien vitae velit. Morbi nec viverra erat.
Nullam scelerisque facilisis pretium. Vivamus lectus leo, commodo ac sagittis ac, dictum a mi. Donec quis massa ut libero malesuada commodo in et risus. Fusce nunc dolor, aliquet vel rutrum in, molestie sit amet massa. Aliquam suscipit, justo a commodo condimentum, enim sapien fringilla ante, sed lobortis orci lectus in ante. Donec vel interdum est. Donec placerat cursus lacus, eu ultricies nisl tincidunt a. Fusce libero risus, sagittis eleifend iaculis aliquet, condimentum vitae diam. Suspendisse potenti. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin leo purus, sodales a venenatis luctus, faucibus ac enim. Sed id metus ac sem lobortis pretium. Mauris faucibus tempor scelerisque. Nunc vulputate interdum tortor, non tincidunt dui condimentum eget. Aenean in porttitor velit. Nam accumsan rhoncus risus id consectetur.
Comments
IE9 scroll with mouse scroll is not working
Hi Piotr,
Thanks for this great plugin. It is very simple, and useful.
I have just 1 comment what is pointed in the subject.
I have tried to solve the problem, but until now without any results.
--
István
thanks
thanks István, I will investigate this issue ASAP.
fixed
hey István, I updated my plugin. I tested it on IE8 and it works fine now so hopefully IE9 should work as well.
thanks
Hi Piotr,
Thanks for the quick response.
I will try it after work.
Thanks
It works. Thanks.
It actually works in IE9.
It actually works in IE9.
The problem comes from this page and how the plugin javascript file is referenced.
It is referenced from GitHub, but GitHub serves the .js file as "text/plain" and not "text/javascript" MIME type.
IE9 considers this as a security problem and does not load the script file.
thanks
thanks Didier! I missed that. I tested it in IE9 but never when linked from github. I'll fix it soon.
updated
Hey, I updated my article page to load it from my own server and not from github. It should be behaving ok on IE now.
Multiscrollbar
hi,
i had a problem when the user was resizing the window ( the slimscroll was applied to a div that depends of viewport size ) . So i invented a way to update scrollbars during a resize event without creating a new one.
Mys solution to this problem :
var resizeHandler = function(element, scroll_id) {
var me = $(element);
me.css("height",$(window).height()+'px');
$(".slimScrollDiv"+scroll_id+"").css("height",$(window).height()+'px');
var height = Math.max((me.outerHeight() / me[0].scrollHeight)
* me.outerHeight(), 30);
$(".slimScrollBar"+scroll_id+"").css({ height: height + 'px' });
}
element is the variable used when you do $(element).slimScrol([...]);
Also i had a problem with multiscrollbars ( when ressinzing the window ) so i created a way to resize each of these scrollbar independently. My solution was to create a counter for each slimscroll applied.
Little error in the given
Little error in the given script :
var resizeHandler = function(element) {
var me = $(element);
me.css("height",$(window).height()+'px');
$(".slimScrollDiv").css("height",$(window).height()+'px');
var height = Math.max((me.outerHeight() / me[0].scrollHeight)
* me.outerHeight(), 30);
$(".slimScrollBar").css({ height: height + 'px' });
}
great idea
Thanks Benjamin, this is a really good idea. Scrollbar adjusting to the changing size of the container makes perfect sense. I will add this feature in the upcoming patch.
Implemented?
Has this been implemented? Essentially the way the script can take the parent width if applied to the height would achieve this functionality. Is that correct?
great idea, but there is a glitch
If there are more than one slimScrolls in a page, if Im not wrong, the above script will apply the same height to ALL scroll regions (since we are applying height property by class [$(".slimScrollBar")], not by ID). Is there a way to refer just that particular scroll region and re-apply height?
great idea, but there is a glitch (RESOLVED!!)
Hi,
I managed to resolve the glitch I reported when re-applying height property to $(".slimScrollBar") (Benjamin's idea). That will re-apply height to ALL slimScroll regions in the page; Benjamin, Im not sure if I understood your solution correctly, but you can confirm on this.
Anyways, you can try this:
STEP 1:
--------
While instantiating slimScroll, pass an extra parameter "id" with some value
$('#dvScrollTest').slimScroll({
id: 'dvScrollTest',
size: '5px'
});
STEP 2:
--------
In the source file (version 0.5.0), apply a class to the wrapper DIV (divS) used for bar,rail etc.
NOTE: make use of the "id" parameter and apply different class name to each scroll region (I have used the prefix "clsSlim_" for class name)
// do it for every element that matches selector
this.each(function(){
...
divS = "<div class='clsSlim_" + o.id + "'></div>",
STEP 3:
--------
Now, when you want to resize slimScroll (to follow its parent's changed height), simply re-apply the height property for wrapper DIV:
$(".clsSlim_dvScrollTest").css("height",$('#dvScrollTest').height() + 'px');
Hope its of use to someone. Thanks.
I am a Beginner
kindly explain this code for the beginner.
Where to add this code?
OR
<body onresize="window.location=window.location">
Demo on this page not working on IE8+
Hi Piotr,
Thanks for the plugin. Your demo on this page works sleek in Chrome, however, it doesn't work on IE8, and IE9.. so probably you'd need to update your code somewhere.
Thanks,
Totti
works for me?
Hey Totti, thanks for your comment.
Can you specify what exactly doesn't work? I just checked this demo on IE8 and it works fine. (Well, rounded corners from scrollbars are missing, but this is known limitation of Internet Explorer). Everything else - scrolling, fade in/fade out, mouse-wheel scroll and so on is ok.
It works on IE8 & 9 , just
It works on IE8 & 9 , just need to use the original code , not minified ( that was my solution )
checked it again
Hey, I checked the minified version and even set up a test case here: http://rocha.la/misc/jsdemos/slimScroll/index.min.htm - everything works fine on IE8 (at least on my pc).
What sort of issues do you see?
not working on IE9
First of all, great work you're made with slimscroll.
Now, talking about the problem, I've implemented it in a webpage and it works very well, except that in IE9 the scroll just works with the mouse scroll, it doesn't work dragging the bar with the mouse.
On your test case, works for me in every browser, but on IE9 it doesn't display the scrollbars at all, just plain text on the page and nothing more.
float does not work
Hey,
at first its a great plugin.
I try to use it with a div that has a float: left. But if I use the plugin the float does no longer work.
Can u tell me what I do wrong.
float fix?
Hi Ronny,
I will have a look into it, but for now, you could create inner div that holds scrollable content, so for example:
.. text.. to.. scroll...
Where #news is your div with float and #news_content is div where you apply $('#news_content').slimScroll();
Not working
Hi there,
I really like the plugin, however I cannot seem to get it to function on my website. I am fairly new to code and totally self taught. Here is is where I have used it - http://www.lilyemo.co.nz/work/honouringAMprayer.html, what have I done wrong?
jQuery draggable
Hey,
I've noticed that you are missing jQuery Draggable. Add this code to the header of your website, immediately after you load jQuery:
(Or you could just download it yourself from jQuery website, but loading it from Google CDN is easier and faster.)
Thanks!
It works great now, thank you!
Wonderful job!
I'm here just to congrat you for the wonderful job you've done!
I really loved it!
Regards, Marcos Gonçalves
thanks
Thanks a lot Marcos! I'm glad you like it. Feel free to post a link to your website and show off what you've done with it! :)
Position of scroll bar
Hey
I've just tested this plugin and already love it. Great job! Finally no more nasty, ugly scrollbars when making only a part of a site scrollable.
There's just one point i'm missing:
Is it possible in any way to get some space between the scrolling div (or whatever you use) and the scrollbar?
EDIT:
ps: i'm using it on a position:absolute <div>, padding didn't help
Could I also suggest this
Could I also suggest this please
Also should the scroller detect if it is needed or not? On my site it appears even if the content doesnt need to scroll
You can see the effect here (and you can see the bar working on the about us page)
Site is an ongoing project so may change
Lee
Paste fail http:/
Paste fail http://virtualdirection.com/index.php#morestuff
good point
Hey Lee, good point. I will patch it in the next version.
Super :) It would be great.
Super :) It would be great.
Super. Ver. 0.2.4 works
Super. Ver. 0.2.4 works perfect. Thank you very much for your work.
Multiple
Hi
Is it possible to add the scroller to all elements with a specific selector. I tried and it doesnt show the scroller?
Thanks
Lee
Multiple elements now allowed
Hi Lee,
Thanks for spotting this defect. I have updated my plugin. Please download newest version - v0.2.3 and you will be able to use $('.className') selector to attach the slimScroll to multiple elements at once.
Thats working on all elements
Thats working on all elements now
As commented earlier, should the scroller be showing up on elements that dont need to scroll? Is it possible to check this, so the scroller is disabled if the content is not larger than the div?
Thanks
Lee
UL elements?
every time i add a <ul> element, the scroll stops working.
any fix?
Variable content
Hi there,
Love the scroller! However, does anybody have any simple amends to this code that would update the scroller depending on variable div content, similar to Benjamin B's solution for viewport size?
Thanks.
pending fix
Hi James, I've seen someone already submitted fix to my github repo tackling this issue. I'll review and create new release.
pending fix
I'm using the latest from github, and the scrollbar doesn't seem to update itself with the content. Is there an option that needs to be set?
little mod
I've added little mod.
When content is smaller than container - slider sholdn't appear. So I added one line in your code:
var height = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
if (height+"px"==cheight) { height = 0 } //added line
bar.css({ height: height + 'px' });
already fixed
hey qczy,
good news - this fix has been already added in the latest release. Download version 0.2.4 from github or jQuery Plugins page and you shouldn't see the scrollbar anymore when content is not long enough.
almost
When using 'alwaysVisible: true' to prevent slider from hiding it still shows full-height slider
adding:
if(barHeight==me[0].scrollHeight) { barHeight = 0 }
in 236 line of new ver (0.4.3) will do the job.
but thanks for reply
by the way - some flattering stuff - good plugin
Border
Hi, scroller is working well now.
Just the one last thing for me, as mentioned above, can we get a padding option when the scroller is needed to prevent it overlapping the content?
Thanks
Lee
Starting at the bottom of content
Thanks for the great plugin, works awesome!
I do have a question though. How would I go about programatically getting to the bottom of the div that has the slimScrollBar? For example, I have a comment section that has comments going top to bottom from the earliest to the latest. If I want the user to skip down to the last comment at the bottom with a button click, and the div uses this slimScrollBar, what would be your suggestion to achieve that?
?
Have you managed to solve this? I am trying to figure out the same things as well.
makes sense
Thanks mnshyn, your suggestion makes sense. I'll add the option to allow automatic scroll-to-bottom.
Pages
Comment