Giter Club home page Giter Club logo

Comments (8)

jrolfs avatar jrolfs commented on June 30, 2024

I did some work to get things working with absolute constraints (so you could do top: 0, right: 0, bottom: 0, left: 0). You can check out my fork/branch here: https://github.com/jrolfs/antiscroll/tree/jamie. I would try and give you more in depth help but I've been super busy lately.

from antiscroll.

raulmatei avatar raulmatei commented on June 30, 2024

Hey, Thanks for your input, I'll take a look on it. I've solved the issue partially by:
HTML:

<body>
  <div class="antiscroll-wrap">
    <div class="box">
      <div class="antiscroll-inner">
        ...
      </div>
    </div>
  </div>

CSS:

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
body {
  overflow: hidden;
}

.antiscroll-inner {
  width: 100%;
  height: 100%;
}

JS:

$(window).on('load resize', function() {
  $('.box').css({
    height: $(window).height(),
    width: $(window).width(),
  });
}).resize();

The remaining problem is that .antiscroll-inner is not getting 100% width/height after a window resize.

from antiscroll.

raulmatei avatar raulmatei commented on June 30, 2024

Thanks again for your input, just solved the issue for my particular case. I've added:

    this.inner.css({
        'width': this.el.width() + scrollbarSize()
      , 'height': this.el.height() + scrollbarSize()
    });

... into refresh method, so there's no need to add the css 100% width/height.

It works for the moment, I'll try to find a better solution in the near future.

from antiscroll.

ursbraem avatar ursbraem commented on June 30, 2024

Hi Raul

I am having the same issue, could you provide an example with the complete fix?

Thanks a lot

Urs

from antiscroll.

raulmatei avatar raulmatei commented on June 30, 2024

Hi, you can find an example of what I did here http://raulmatei.com/s/, I've added a scroll track for my project no need for you to copy that part.

from antiscroll.

ursbraem avatar ursbraem commented on June 30, 2024

Thanks a lot! I'll try to adapt it and post my version

from antiscroll.

raulmatei avatar raulmatei commented on June 30, 2024

You welcome, hope it helps.

from antiscroll.

Lazza avatar Lazza commented on June 30, 2024

Thank you @raulmatei, your fix worked perfectly for me as well.

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.