Grow your CSS skills. Land your dream job.

Moving box auto scroll and loop

  • # July 16, 2012 at 5:29 am

    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.

    http://jsfiddle.net/Mottie/jMXx3/94/
    #set the circular motion true then try.

    I would like to how to fix it.

    Any comment or suggestion would be appreciated.
    Thanx.

    # July 16, 2012 at 9:45 am

    my bad
    correct example: http://jsfiddle.net/nori2tae/CRq32/

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

    # February 5, 2013 at 8:51 am

    open the slider.js

    go to 77. line

    write:

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

    goodluck

    # February 5, 2013 at 12:47 pm

    @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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".