Coder Social home page Coder Social logo

Adding slides after specific index. about cycle2 HOT 5 CLOSED

malsup avatar malsup commented on September 27, 2024
Adding slides after specific index.

from cycle2.

Comments (5)

malsup avatar malsup commented on September 27, 2024

That's not supported by C2 and it really sounds like an extreme edge case. You can either append or prepend slides to the container with the "add" command. To prepend, add a third argument of true.

from cycle2.

dog5tar avatar dog5tar commented on September 27, 2024

Hi malsup,

well... it's not that extreme :)

You have an example which displays tweets in a vertical carousel. Imagine this scenario.

Every minute an AJAX call is made to fetch new tweets. When a new tweet comes, it should be inserted just after currently showed slide. Appending new tweets leaves user "out of date" as it might take minutes to cycle to new tweets.

Let me know your thoughts on this.

from cycle2.

malsup avatar malsup commented on September 27, 2024

I would argue that the tweets should always be in chronological order and that inserting new ones somewhere in the middle doesn't make sense. Given that, I suggest either appending or prepending the new slides and then programmatically advancing the slideshow to the desired slide index.

See 'goto' docs: http://jquery.malsup.com/cycle2/api/#commands

from cycle2.

ManickYoj avatar ManickYoj commented on September 27, 2024

Thank you for answering the question about prepending! I've been looking all over for that!

from cycle2.

misund avatar misund commented on September 27, 2024

I have been looking for how to prepend for about an hour. I guess it could be really helpful for others if something about the prepend option were to be included in the API documentation.

from cycle2.

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.