Coder Social home page Coder Social logo

Scrolling Doesn't Loop about smooth-div-scroll HOT 1 CLOSED

tkahn avatar tkahn commented on September 6, 2024
Scrolling Doesn't Loop

from smooth-div-scroll.

Comments (1)

tkahn avatar tkahn commented on September 6, 2024

Hi!

I got the exact same question on Stackoverflow (http://stackoverflow.com/questions/11935652/smooth-div-scroll-jquery-plugin-endless-loop-not-working) and answered it there, but since I'm not sure if it was you who asked that question as well, I'll post the answer here too:

The reason why the scroller grinded to a halt when it came to the Radio Shack logo was that the scrollable area didn't contain enough logos "to go around". So when it reached the Radio Shack logo and tried to swap for the next logo in the never ending queue, there was no free (not visible) logo to switch to.

I fixed this by adding a couple of more logos to the scrollable area. If you try the same demo page (http://smoothdivscroll.com/clickableLogoParade.html) now it will work fine. Sorry about the faulty demo!

Two important rules when you implements Smooth Div Scroll:

  1. The combined width of all the elements inside the scrollable area need to be bigger than the width of the scroller.
  2. If you are using the autoscrolling option, apart from rule 1, you also need to make sure that there are enough elements so the scroller can swap.

For rule number 2 you can imagine a man standing by a conveyor belt full of printed photos. Every time a photo falls off the edge at the end, this man picks it up, runs to the beginning of the conveyor belt and puts it there. And this goes on in a never-ending loop.

Good luck!

/Thomas

from smooth-div-scroll.

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.