Open passariello opened 5 years ago
PS: I use $("[class*='nicescroll']").remove(); to remove all scroll before my ask but it's a bit rude but work.
LIKE:
$("[class*='nicescroll']").remove();
CustoScrollBar('#myDiv1'); CustoScrollBar('#myDiv2'); CustoScrollBar('#myDiv3'); CustoScrollBar('#myDiv4');
After some test I find a solution using a nested DIV inside another... like:
<div id="mypage">
<div id="mypageAjax"> contents here </div>
</div>
If I ask some contents to put on "mypageAjax" and after I call the niceScroll it works well. All divs are position absolute in a relative body position.
Hi guys! I am at work to implement niceScroll on a project but I see that when a div is called by Ajax every time the scrollbar was duplicated. This not happen when I use autohidemode: false or other. We need to remove and recreate the scroll if exist.
I have try .remove(); but not work and probably need to be automatic
/***/
function CustoScrollBar(val){ $(val).getNiceScroll().remove(); $(val).niceScroll({ autohidemode: false }); }
THE CALL: CustoScrollBar('#myDiv'); // or .myDiv