File "main-base.js"
Full Path: /srv/www/www.cadoro.it/src/js/main-base.js
File size: 1.78 KB
MIME-type: text/plain
Charset: utf-8
$(function () {
$('a[rel=gallery]').on('click', function (e) {
e.preventDefault();
}).fancybox();
$('a[rel=external]').attr('target', '_blank');
$('[data-behaviour~=privacy-cookie-close]').click(function (e) {
e.preventDefault()
$(e.target).closest('.privacy-cookie').slideUp()
$.ajax({
url: '/'
, type: 'post'
, data: {'cookie': 1}
})
})
$('a[href^=\\#]').click(function(e) {
e.preventDefault()
var anchor = $(e.target).closest('a').attr('href').substr(1)
var scrollTop = $('a[name=' + anchor + ']').offset().top
$('html, body').stop().animate({
scrollTop: scrollTop
}, 1000, 'easeInOutExpo');
})
$('body').on('custom:datepicker', '[data-behaviour~=datepicker]', function () {
$(this).datepicker({
'dayNamesMin': ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"]
, 'monthNames': ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"]
, 'dateFormat': "dd/mm/yy"
})
});
$("[data-behaviour~=datepicker]").trigger('custom:datepicker');
$("[data-behaviour~=numeric]").numeric({allowMinus: false});
if (self.location.hash) {
var $target = $(self.location.hash + '-scroll')
if ($target.length) {
var scrollTop = $target.offset().top
setTimeout(function () {
$('html, body').stop().animate({
scrollTop: scrollTop + 150
}, 1000, 'easeInOutExpo');
}, 500);
}
}
$('.carousel').carousel({
interval: 3000
});
$('[href="/punti-vendita/popup"]').click(function (e) {
e.preventDefault();
e.stopPropagation();
$.fancybox.open({
href: '/punti-vendita/popup'
, type: 'iframe'
, width: 280
, height: 300
, autoSize: false
});
});
})