Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome to v.46 #361

Open
sentbyravens opened this issue Oct 17, 2015 · 4 comments
Open

Chrome to v.46 #361

sentbyravens opened this issue Oct 17, 2015 · 4 comments

Comments

@sentbyravens
Copy link

Hi, malihu!
We are using mCustomScrollBar v. 3.1.1 for smooth scroll to anchors from another pages.
But our code just stop works after we update Chrome to 46.0.2490.71.

But if we will use version 3.0.9, anchors start work again. Can you solve that issue, please?

Our code:

$(window).load(function () {
                var hash = $(location).attr('href').split('#')[1];
                $('html, body').scrollTop(0);
                if ( typeof hash != 'undefined'){
                    var $_elem = $('#' + hash);
                    var offset = $_elem.offset().top - 30;
                    $(".right_content_container").mCustomScrollbar("scrollTo", offset);
                }
            });
@malihu
Copy link
Owner

malihu commented Oct 17, 2015

Hello,

I'm not sure about this... Your code seems correct and I've just tested it on latest Chrome (46.0.2490.71) with plugin version 3.1.1 and it does work.

Do you get any console errors in Chrome dev tools? Can you send me a link?

@sentbyravens
Copy link
Author

Sure! We are just created 2 pages with a different version of plugin (mcustomscrollbar with version 3.0.9 and mcustomscrollbar2 with version 3.1.1) special for you. There is a links encoded in base64 (UTF-8)(https://www.base64decode.org/):
For 3.0.9 aHR0cDovL3RlYW10cmFucy5iaXovbWN1c3RvbXNjcm9sbGJhci8=
For 3.1.1 aHR0cDovL3RlYW10cmFucy5iaXovbWN1c3RvbXNjcm9sbGJhcjIv

For navigation please use links like on a screenshot:
screenshot_52

@malihu
Copy link
Owner

malihu commented Oct 20, 2015

Firstly, thanks for creating the pages so I could see what's really going on :)

So here's the deal...

The scrollbar on 3.1.1 page didn't work correctly at all (not just the scroll-to anchors). This is because you have the following CSS rule in teamtrans.css on line 794:

.mCSB_container, .mCustomScrollBox {
    overflow: visible !important;
}

You need to remove the .mCustomScrollBox selector from this rule:

.mCSB_container {
    overflow: visible !important;
}

Doing this will immediately fix everything (scrolling, anchors etc.).

.mCustomScrollBox element needs to be overflow:hidden, otherwise in version 3.1.x the scrollbar won't work. That is because I did update the auto-update function to be much more efficient.

By removing the selector, you'll probably need to adjust some other CSS rules to make the right red border visible again. I'm guessing removing padding-right: 15px; from .right_content_container and margin-right: -15px; from .row will do the trick.

Also, you could use the theme:"minimal-dark" in order to make the scrollbar visible on the white/light-colored background (I'm not sure you want this).

@sentbyravens
Copy link
Author

Thank you very much for answer! We will fix it today! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants