Coder Social home page Coder Social logo

diegoversiani / smooth-parallax Goto Github PK

View Code? Open in Web Editor NEW
87.0 3.0 17.0 348 KB

Smooth Parallax makes it a lot easier to move objects when the page scroll with ease.

Home Page: https://diegoversiani.me/smooth-parallax/

License: MIT License

JavaScript 87.16% HTML 12.84%
parallax parallax-scrolling parallax-javascript-library background-image smooth-animations smooth-scrolling elements-movement movement

smooth-parallax's People

Contributors

diegoversiani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smooth-parallax's Issues

(Can't start at negative y position?) Cannot get image to position at top of page (Blogger/BlogSpot)

I am trying to use Smooth Parallax with a background image on Blogger/BlogSpot. However, I cannot get the image to start at the top of the page when scrolled all the way to the top; the background image always jumps down a little bit after the page loads.

I tried modifying start-position-y to "0" and a negative quantity, but it made no difference. Maybe my container is the problem? I think it would be helpful to allow negative values for start-position-y if you don't already (but it looks like you already do, based on your hippie van example).

JS:

    <script type="text/javascript" src="https://wad11656.github.io/smooth-parallax.min.js"></script>
    <script type="text/javascript">
      window.addEventListener("load", function () {
        SmoothParallax.init();
      });
    </script>

HTML Body:
<img class="parallax_bg" src="https://drive.google.com/uc?id=1EHze1D1aTRvMiEWLNhUT7vwYVvJ1Ahxv" container=".content-outer" smooth-parallax="" start-movement="0.09" end-position-y="2.5"></img>

CSS:

.parallax_bg {
  width: 100%;
  z-index: 0;
  position:absolute;
}

What's wrong with it?

HTML structure:

...
<div class="site-offset">
    <a href="#" id="k-flux" smooth-parallax="" container=".site-offset" start-movement="0.05">FLUX</a>
    <div id="content" class="content">
    ...
    </div>
</div>
...

Init as required:

<script type="text/javascript">
  window.addEventListener("load", function () {
    SmoothParallax.init();
  });
</script>

If well understood the point, #k-flux should move within ".site-offset". No error, warning or whatsoever. It just doesn't work.

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.