File: D:/HostingSpaces/SBogers96/smilefotografie.nl/wwwroot/js/app/core/swiper.js
define('core/swiper',['src/swiper'],function(swiper)
{
return {
initialize : function()
{
var t = this;
var $container = $('.swiper-container');
if($container.size())
{
$container.addClass('loaded');
var speed = 1200;
// Default options
var options = {
grabCursor: true,
speed: speed,
spaceBetween: 100,
//autoplay: 3000,
nextButton: '.next',
prevButton: '.prev',
keyboardControl: true,
onInit: function(images)
{
t.resize();
updateCounter(images);
},
onSlideChangeStart : function(images)
{
updateCounter(images);
}
};
// Custom properties
var custom = $container.attr('data-custom');
if(typeof custom !== typeof undefined && custom !== false)
{
if(custom == 'home')
{
options.speed = 1200;
options.autoplay = 3000;
options.loop = true;
options.spaceBetween = 0;
options.effect = 'fade';
}
}
// Setup slides
new Swiper('.swiper-container',options);
}
},
resize : function()
{
var $swiper = $('.swiper-container');
if($swiper.hasClass('swiper-resize'))
{
var width = $swiper.width();
var height = width * 2/3;
$swiper.height(height);
}
}
};
function updateCounter(images)
{
$('.counter').html((images.activeIndex + 1) + ' / ' + images.slides.length);
}
});