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

this.mcs.leftPct Response Different value in firefox #595

Open rvpatel opened 6 years ago

rvpatel commented 6 years ago

Now we have calculate percentage of value on scroll but Firefox & chrome arrived different value.

$(document).on("click", '.right_arrow', function(event) {
    $(".glslider_inner").mCustomScrollbar({
        axis: "x",
        mouseWheel: false,
        callbacks: {
            onScroll: function() {
                if (this.mcs.leftPct == 100 ) {
                    maxLimitReached = true;
                    // if maxLimit Reached (max width then...)
                    $('.glrightnav').hide();                                    
                    // alert('right100');

                } else if (this.mcs.leftPct == 0) {

                    minLimitReached = true;
                    // if minLimit Reached (basic width then...)
                    $('.glleftnav').hide();
                } else {
                    maxLimitReached = false;
                    minLimitReached = false;
                }
            }
        }
    }); 
});