slider.js
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$(document).ready(function (){
if (jQuery().flexslider) {
//flexslider ticker
$('.flexslider-ticker').each(function() {
var tickerSettings = {
animation: "slide",
animationLoop: false,
selector: ".items > .item",
move: 1,
controlNav: false,
slideshow: true,
direction: 'vertical'
};
$(this).flexslider(tickerSettings);
});
// flexsliders
$('.flexslider').each(function() {
var sliderSettings = {
animation: $(this).attr('data-transition'),
selector: ".slides > .slide",
controlNav: false,
smoothHeight: true,
prevText: "",
nextText: "",
sync: $(this).data('slidernav') || '',
start: function(slider) {
if (slider.find('[data-slide-bg-stretch=true]').length > 0) {
slider.find('[data-slide-bg-stretch=true]').each(function() {
if ($(this).data('slide-bg')) {
$(this).backstretch($(this).data('slide-bg'));
// $(this).data('slide-bg');
}
});
}
}
};
$('html').addClass('has-flexslider');
$(this).flexslider(sliderSettings);
});
$(window).delay(1000).trigger('resize'); //make sure height is right load assets loaded
}})