File: D:/HostingSpaces/SBogers10/topswtw.komma.pro/wwwroot/js/app/modules/productDiscountNotifier.js
define([],function()
{
$(function(){
$('.product-block .discount-notifier').each(function(){
var $items = $('.notifier-items > li', this);
var $navigation = $('.notifier-navigation > li', this);
var currentSlide = 0;
var nItems = $items.length;
var slideTime = 5000;
var showItem = function(imageNumber){
$items.removeClass('active');
$navigation.removeClass('active');
$items.eq(imageNumber).addClass('active');
$navigation.eq(imageNumber).addClass('active');
};
var nextItem = function(){
if(++ currentSlide >= nItems) currentSlide = 0;
showItem(currentSlide);
};
$(document).on('ProductNotifierIntervalEvent', function(e){
nextItem();
});
});
setInterval(function(){
$(document).trigger('ProductNotifierIntervalEvent');
}, 5000);
});
});