Using slimscroll with jquery live() or on()

276 views Asked by At

I want to use slimscroll plugin on an ajax created page. So I need to use it with jquery live() or on() function. How should I use it?

1

There are 1 answers

0
Marthijn Bontekoning On

I had the same problem with slimscroll. I couldn't fix it, so I went to Google again. Found this one: https://github.com/LearnBoost/antiscroll.

It claims to use native browser controls, so it should be better than most scrollbar extensions.

Hope this helps you!

Edit: Ow, don't forget to call $('.antiscroll-wrap').antiscroll(); after you edited the content of your page.

Tip: For those who use $.clone() and find themselves having multiple (non-functional) scrollbars, use this to remove them:

var antiscrollWrap = $clone.children(".antiscroll-wrap").first();
var antiscrollInner = $(antiscrollWrap).children(".antiscroll-inner").first();
$(antiscrollWrap).html(antiscrollInner);