mzubala / jquery-custom-scrollbar

189 stars 102 forks source link

updateOn parent resize feature #31

Closed Pixelalb closed 10 years ago

Pixelalb commented 10 years ago

Thank you for the plugin!

I'd like to update when the parent of scrollable div is resized. Is it possible to achieve this? (similar to updateOnWindowResize)

Thank you!

mzubala commented 10 years ago

It's not possible to listen to dom changes, so whenever contents of your div change causing size change, you have to call the resize function yourself.

$("....").customScrollbar("resize")

This will update the scrollbar to the new size. There's a demo that shows how to do it. You can check it out here:

http://jquery-custom-scrollbar.rocketmind.pl/expandable_list.html

The source code is in the repo inside demos folder.

Pixelalb commented 10 years ago

Thank you!