publik-website/static/js/combo.public.js

35 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$(function() {
$('.intro').parallax("60%", -0.2);
$('.bistro').parallax("0%", 0.2);
$('.bistro > div').parallax("2%", 1.2);
$('a[href^="#"]').on('click',
function() { $.scrollTo($(this).attr('href'), 1000); }
);
if ($('.ecrans').length > 0) {
var $window = $(window);
var offset = parseInt(Math.random()*2000);
var $ecrans = $('.ecrans');
var pos = $window.scrollTop();
$ecrans.css('background-position', (offset + pos/2) + 'px 0px');
$window.bind('scroll', function() {
var pos = $window.scrollTop();
$ecrans.css('background-position', (offset + pos/2) + 'px 0px');
});
}
if ($('div[id|=chiffres]').length) {
var $chiffres_section = $('div[id|=chiffres]');
$chiffres_section.css('position', 'relative');
var total = $chiffres_section.attr('id').split('-')[1];
var $counter = $('<span id="counter"></span>').appendTo($chiffres_section);
var options = {
useEasing : true,
useGrouping : true,
separator : '',
prefix : '',
suffix : ' usagers'
};
var count = new CountUp("counter", 1234, parseInt(total), 0, 4.5, options);
$chiffres_section.on('inview', function() { count.start(); });
}
});