Git Product home page Git Product logo

Comments (3)

tylernotfound avatar tylernotfound commented on July 16, 2024

For performance optimization, the plugin doesn't get into the core if only one slide is present. Among other things, this means the options you are passing are not set.

My suggestion is to create an if statement (wherever it makes the most sense relative to the flexslider() call), and put your start callback logic there. I highly doubt this will change in future versions of FlexSlider as someone with such a specific use-case should be able to handle the logic themselves, keeping unnecessary bulk away from the plugin itself.

from flexslider.

dustinhorton avatar dustinhorton commented on July 16, 2024

yeah it was certainly easy to fix, but i'd be really surprised to hear this is a 'specific' use case. using it in a another site already that is a similar implementation.

regardless, just wanted to make sure it was mentioned. awesome plugin, thanks.

from flexslider.

JonMcL avatar JonMcL commented on July 16, 2024

Is it cool to add to a closed issue on Github?

I might be a good idea to allow the code to initialize if there is only one slide. Perhaps an optional parameter.

Use case is when loading content via AJAX and I want the new content to be appended to the slides (or inserted somewhere in the list) and then slide it into view. I will be using addSlide() to add the new slide/content.

The problem is that I start out with only one slide and then I can't use addSlide() for the second (and third, and fourth) slides since the initialization never happened.

I'm going to hack in a temporary slide that is empty and then remove it -- or possibly use it for the second piece of content. So just something to consider the future?

..jon

from flexslider.

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.