Comments (3)
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.
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.
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)
- Prevent vertical swipe while swiping horizontally HOT 2
- Fix for Number-typed values are deprecated for jQuery.fn.css
- Forbid to tab through the slider HOT 1
- swipe is reverse in RTL
- $( '.flexslider' ).flexslider({ is not running occasionally HOT 1
- hiding slides with display:none to filter them... way to 'recount' the slides after doing so
- Using iframes (yt-videos) in flexslider breaks the last slide (animation: slide)xslider HOT 1
- Trouble placing multiple instances of flexslider on a website or page
- When animationSpeed becomes large, the image doesn't switch to a smartphone with Chrome's Devtools.
- The package could not be installed. Trying to install the plugin, get an empty plugin error?
- Fetching Thumbnail images dynamically
- Not compatible with Google Chrome and rtl mobile browsers HOT 1
- Is FlexSlider abandoned? HOT 1
- fix scrolld in 5000 min
- How to setup Flexslider in a gulpfile HOT 1
- FlexSlider prevents use of back/forward cache
- does not start on the first slider HOT 1
- slide container gets bigger when another slide has a tall vertical or horizontal image
- Cannot read properties of undefined (reading 'toLowerCase'
- thumbCaptions setting creates invalid html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexslider.