Froxz Froxz - 3 months ago 8
Ajax Question

Custom scroll bar! After Ajax Completed

I have a small problem. I have a js ajax call to php.

PHP:

echo '<div class="center-right-inside"></div>';


Before ajax I create divs

$('.main').fadeIn('slow').html('<div class="right-left"><div class="left-c"></div><div class="center-c"></div><div class="right-c"></div></div>');


In my JS I use plugin http://manos.malihu.gr/jquery-custom-content-scroller/
And after in created div I load another div on witch I want to use plugin... But no luck

complete :function(){
$('.center-c').fadeIn();
$('.center-right-inside').mCustomScrollbar("update");
}


I tried:

$(".center-right-inside").mCustomScrollbar();


this on DOM ready and it is working fine but when ajax is complete no...

Before posting this question I read Docs of the plugin and search at google and SO but couldnt find any similar if any suggestion thanks in advance.

Answer
$(".center-right-inside").mCustomScrollbar({
    advanced:{
        updateOnContentResize: true
    }
});

This should help!