1

I am using nicescroll library js because i want to make my div scroll nice rather than default scroll. I want to make scroll to markerlist ul which is generated by javascript.

enter image description here

I have added nicescroll javascript library like this:

<script src="http://areaaperta.com/nicescroll/js/jquery.nicescroll.min.js"></script>

and function like this:

<script type="text/javascript">
$(function() {
    $("#markerlist").niceScroll();
});
</script>
Ashish Patel
  • 1,011
  • 13
  • 27

1 Answers1

0

Maybe you can set a timeout before applying nicescroll. When All contents are loaded then apply nicescroll. Or if you are using a div which shows after clicking a button you can put the code in your click handler function.

$(window).on('load', function() {
  window.setTimeout(function() {
        $("#markerlist").niceScroll();
    }, 200);
});
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77