Automattic / antiscroll

OS X Lion style cross-browser native scrolling on the web that gets out of the way.
1.07k stars 162 forks source link

2 vertical scroll on Firefox #78

Open Daniel19840 opened 10 years ago

Daniel19840 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 9 years ago

Duplicate of #77