Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add or remove slides using jQuery FlexSlider

Is it possible to add or remove slides in runtime using FlexSlider?

like image 507
Diogo Cardoso Avatar asked Jan 19 '12 16:01

Diogo Cardoso


2 Answers

The new version of FlexSlider 2 already supports this methods.

slider.addSlide(obj, pos) accepts two parameters, a string/jQuery object and an index. slider.removeSlide(obj) accepts one parameter, either an object to be removed, or an index.

like image 114
Diogo Cardoso Avatar answered Sep 30 '22 19:09

Diogo Cardoso


This is just what I saw after looking at this thread.

The slider and the carousel object can be instantiated and added to like this:

$('#slider').data('flexslider').addSlide("");

$('#carousel').data('flexslider').addSlide("");

The click on the carousel to scroll to the particular image doesn't work, but the scroll buttons on both work.

like image 38
Stephen Himes Avatar answered Sep 30 '22 17:09

Stephen Himes