The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Moving box auto scroll and loop

  • This topic is empty.
Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
  • #106177

    Hi first of all, moving boxes is the one I’ve been looking for.
    Great script.

    I am close to full satisfied, but one thing bothers me.

    I set the wrap motion true then one element disappears
    at some moment before sliding as i scroll around.
    You can experience that in this example too.
    #set the circular motion true then try.

    I would like to how to fix it.

    Any comment or suggestion would be appreciated.


    my bad
    correct example:

    It seems that this problem happens when the slide moves back to its default position.


    open the slider.js

    go to 77. line


    setInterval( function() {
    base.change(base.curPanel + 1);
    }, 5000 );



    @nori2tae In order to loop the slides in MovingBoxes, it clones the first and last slides. These clone slides are added to the end and beginning, respectively. So when you reach the last slide, you see the first cloned slide to the right. And when you see the first slide, the slide to the left of it is a clone of the last slide. When wrapping from the last to first slide, the script automatically jumps to the last cloned slide (left of the first slide) after you click the next arrow, this is why the slide to the left disappears. Also, if you are viewing the first slide and press the left arrow, the plugin repositions the slides so that the last slide (clone of the first slide) is centered, making the slide on the left disappear.

    The only way to fix this would be to clone the first two slides, and the last two slides. Then things get really messy because the actual first slide is really the third slide.

    I hope this all makes sense. Adding more code to cloning more slides just to prevent a brief flash of a slide disappearing while animating doesn’t seem worth the effort to me. If it gets too annoying, just set the width of the slider and the width of the panels inside to be almost the same, so only one panel is visible at a time.

Viewing 4 posts - 16 through 19 (of 19 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.