Skip to content

Instantly share code, notes, and snippets.

@erunyon
Created March 3, 2013 00:28
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erunyon/5073909 to your computer and use it in GitHub Desktop.
Save erunyon/5073909 to your computer and use it in GitHub Desktop.
Flexslider code to remove comments from slider images.
jQuery(function($){
var $flexslider = $('.flexslider'),
$slides = $flexslider.find('li'),
stripComment = function(string) {
return string.replace(/<!--/g, '').replace(/-->/g, '');
},
initItem = function(item) {
var $this = $(item);
if(!$this.hasClass('init')) {
$this.html(stripComment($this.html())).addClass('init');
}
}
;
$flexslider.flexslider({
animation: "slide",
slideshow: false,
controlsContainer: ".flexslider-container",
start: function(){
$flexslider.find('.flex-active-slide, .clone').each(function(){
initItem(this);
});
},
before: function(){
$slides.each(function(){
initItem(this);
});
}
});
});
@elimc
Copy link

elimc commented Sep 10, 2013

So, does the slider start animating on it's own? Or does the user have to manually click through the slides for the next image to load?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment