malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.51k forks source link

No showing on Chrome #84

Open dajona7 opened 11 years ago

dajona7 commented 11 years ago

Hi there...

I have an app that is divided on "left-menu" and the content of the page. On the left side I load (dinamically with AJAX) a menu and some other controls. First the scrollbar doesn't appear automatically (I guess that happened because the declaration of the object <$(".newScrollBar").mCustomScrollbar({...});> was on document.ready and the container height doesn't needs scroll until the AJAX function finishes); so I put that declaration on the "complete" part of the AJAX function and BINGO, the scroll appears correctly, BUT ONLY ON FIREFOX AND IE, on Chrome the menu appear for a mili-seconds and then desappear.

AJAX function:

function getMenu() {
        $.ajax({
            type: "POST",
            .
            .
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            beforeSend: function () {
                //Some code
            },
            success: function (msg) {
                //Some code
            },
            error: function (msg) {
                //Some code
            },
            complete: function () {
                $(".newScrollBar").mCustomScrollbar({
                    theme: "dark-thick",
                    scrollButtons: {
                        enable: true
                    }
                });
            }
        });
    }

Extra info:

malihu commented 11 years ago

Hello,

Do you get any console errors in chrome developer tools? Can't really help since I don't have access to your code but it might help to check the following working ajax demo I've put on plugin homepage (it's under "Additional demos & examples"): http://manos.malihu.gr/tuts/custom-scrollbar-plugin/ajax_example.html