Skip to content

Instantly share code, notes, and snippets.

@afalchi82
Created September 23, 2015 07:31
Show Gist options
  • Save afalchi82/0ab0f7587c6e1d9e9620 to your computer and use it in GitHub Desktop.
Save afalchi82/0ab0f7587c6e1d9e9620 to your computer and use it in GitHub Desktop.
Add slide to FlexSlider 2
var s = $('.flexslider'),
// Clone another slide markup
newSlide = s.find('li').eq(0).clone()
// Change image source
.find('img').attr('src', 'http://www.awwwards.com/awards/submissions/2015/09/5601375a79570.jpeg')
// Return parent element
.end();
s.data('flexslider').addSlide(newSlide, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment