Skip to content

Nicescroll with dynamic content

inuyaksa edited this page Dec 29, 2011 · 2 revisions

If your page or content have dynamic contents height can shrink or expand. In this situation you need request nicescroll to recheck size of page or container.

To recheck height of page/container you have to call resize() method, as:

$("name-of-div").getNiceScroll().resize()

When you use jquery animation, it could affect height, so you need recall "resize" at the end of animation, as:

$("animated-div").slideDown(function(){
  $("name-of-div").getNiceScroll().resize();
});