Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved jCarousel js into seperate function

  • Loading branch information...
commit fced3af8043567fa1d216a9ab038753ac0467013 1 parent 1328221
@stevenwilkin authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 public/js/trends.js
View
10 public/js/trends.js
@@ -1,3 +1,6 @@
+/**
+ * jCarousel
+ */
function itemVisibleIn(carousel, item, i, state, evt){
var idx = carousel.index(i, $('#images ol li').length);
var h = $($('#images li')[idx - 1]).html();
@@ -8,7 +11,7 @@ function itemVisibleOut(carousel, item, i, state, evt){
carousel.remove(i);
}
-$(document).ready(function(){
+function initCarousel(){
$('#images ol').hide();
$('#images-clip').append('<ul id="carousel" class="jcarousel-skin-tango">');
$('#carousel').jcarousel({
@@ -21,4 +24,9 @@ $(document).ready(function(){
itemVisibleInCallback: {onBeforeAnimation: itemVisibleIn},
itemVisibleOutCallback: {onAfterAnimation: itemVisibleOut}
});
+}
+
+
+$(document).ready(function(){
+ initCarousel();
});
Please sign in to comment.
Something went wrong with that request. Please try again.