Created
March 3, 2013 00:28
-
-
Save erunyon/5073909 to your computer and use it in GitHub Desktop.
Flexslider code to remove comments from slider images.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?