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

2 vertical scroll on Firefox #78

Open
Daniel19840 opened this issue Apr 15, 2014 · 5 comments
Open

2 vertical scroll on Firefox #78

Daniel19840 opened this issue Apr 15, 2014 · 5 comments

Comments

@Daniel19840
Copy link

Hi!

On Firefox 28.0 on OS X I get two vertical scrollls. I could not find what's wrong. Any Clue?

Works fine on Chrome and Safari too.

here is the example URL : http://www.pannel.cl/page-hacemos-stands.php

Thanks fot your help

@AlexGilleran
Copy link

I'm getting this too - it's happening because the scrollbarSize is 0 on FF under OSX (which is true, it pops up over the page) so Antiscroll doesn't extend its inner div to hide the scrollbar, but FF doesn't support scrollbar hiding like Chrome/Safari, so the result is that the native scrollbar pops up over the non-native one.

I'm not sure how to fix this properly, but a (nasty) workaround is to modify the scrollbarSize() function in antiscroll.js so that it returns 17 if the result is 0. This extends the inner div even in browsers that don't need it, but that doesn't seem to have any ill effects in the limited testing I've done:

function scrollbarSize () {
  if (size === undefined) {
    var div = $(
        '<div class="antiscroll-inner" style="width:50px;height:50px;overflow-y:scroll;'
      + 'position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%"/>'
      + '</div>'
    );

    $('body').append(div);
    var w1 = $(div).innerWidth();
    var w2 = $('div', div).innerWidth();
    $(div).remove();

    size = w1 - w2;
  }

  return size ? size : 17;
};

@chearon
Copy link

chearon commented Aug 18, 2014

That would extend the content area 17 pixels beyond the right edge, too, though. I think the only way for this to work in FX is if they supported us hiding the scrollbar via CSS. For now I'm just letting both up even though it's ugly

@AlexGilleran
Copy link

Extending the content area beyond the right edge is how it works in IE.

EDIT: Oh yeah I see, FF in OSX has actual content in that area whereas IE doesn't. Fortunately I don't have anything important to the right of the scrolled area...

@chearon
Copy link

chearon commented Aug 20, 2014

Right, because the idea behind Antiscroll is to push only the area taken up by the scrollbar beyond view. But Firefox's scrollbar is an overlay so you'd be pushing some content over along with the visible scrollbar. I think it should be reported to the Firefox team because this sucks!!

@pirxpilot
Copy link
Contributor

Duplicate of #77

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

4 participants