Created
July 1, 2014 04:13
-
-
Save jaseflow/de3a858a33219dbb1e11 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/*globals jQuery, $, wotif, wotifConfig */ | |
wotif.carousel = (function (utils) { | |
var selectors = { | |
space: '#carousel' | |
}, | |
self, | |
nodes, | |
promo, | |
templateHtml, | |
template, | |
defaultOptions = { | |
maxSlide: 4, | |
useCSS: true, | |
slideWidth: 300, | |
slideMargin: 20, | |
slideMove: 4, | |
controls: false | |
}; | |
_.templateSettings = { | |
interpolate: /\{\{(.+?)\}\}/g | |
}; | |
return { | |
init: function () { | |
self = this; | |
nodes = wotif.utils.getNodes(selectors); | |
templateHTML = '<li><a href="{{url}}"><img src="{{image}}"></a></li>'; | |
template = _.template(templateHtml); | |
if (wotif.homepagePromotions) { | |
var list = $('<ul class="lightSlider">'); | |
nodes.space.append(list); | |
$(wotif.homepagePromotions).each(function(i, promo){ | |
var item = template(promo); | |
list.append(item); | |
}); | |
} | |
} | |
}; | |
}(wotif.utils)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment