Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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

This comment has been minimized.

Show comment Hide comment
@elimc

elimc 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?

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