mzubala / jquery-custom-scrollbar

189 stars 102 forks source link

Activates after resize window #25

Closed lexa13 closed 10 years ago

lexa13 commented 10 years ago

Hi,

Thank You for this fine plugin!

I have one issue. Plugin activates scrollbar only when I make resize of window.

here:

http://1analitik.com/category/afghanistan-usa-2009/#articles

Thank You

Regards

Alex

mzubala commented 10 years ago

It activates the scrollbar when you resize the window cause you're using updateOnWindowResize: true flag. It's not meant for your use case, so don't use it. It should work without it.

The reason why it doesn't activate the scrollbar after the page is loaded is that the scrolbbar is initialized before the content of scrolled container is loaded. Make you sure you call $().customScrollbar() after everything is in place in your container. Alternatively if you can't do it for some reason you can always call $().customScrollbar("resize") - that's useful if you change contents of your container after page is loaded.

lexa13 commented 10 years ago

Oh, thank You, Maciej.

I'll more watchful next time.

Sorry to trouble.