Code Monkey home page Code Monkey logo

Comments (5)

AlexGilleran avatar AlexGilleran commented on May 28, 2024

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;
};

from antiscroll.

chearon avatar chearon commented on May 28, 2024

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

from antiscroll.

AlexGilleran avatar AlexGilleran commented on May 28, 2024

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...

from antiscroll.

chearon avatar chearon commented on May 28, 2024

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!!

from antiscroll.

pirxpilot avatar pirxpilot commented on May 28, 2024

Duplicate of #77

from antiscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.