File: D:/HostingSpaces/SBogers10/sportivo.komma.pro/wwwroot/js/home.js
/**
* Created by Pascal on 06/11/15.
*/
$(function(){
resizing2();
$.smartbanner({
title: 'Sportivo Cranendonck',
daysHidden: 30,
daysReminder: 30,
price: 'Gratis'
});
$('.sportivo-call').click(function(){
$('html,body').animate({
scrollTop: $('.content-block1').offset().top - 60
}, 800)
});
$(window).resize(function(){
resizing2();
});
if(tabletOrMobile()){
console.log(window.mobileAndTabletcheck);
$('.home .video-background').height($('.video-background iframe').height());
$('.video-background iframe').css('display', 'none');
$('.home .video-background').css('background', 'url("/images/structure/placeholderVideo.jpg")');
$('.home .video-background').css('background-size', 'cover');
}
});
function resizing2(){
//Makes the home video the right format
$('.video-background iframe').height(($('.video-background').width()/16)*9);
$('.video-background').css('max-height', $(window).height());
//Makes the arrow like figure in the homepage at the sportivo action
$('.sportivo-call .background-block').css('border-left' ,$('.video-background').width()/2+'px solid transparent');
$('.sportivo-call .background-block').css('border-right' ,$('.video-background').width()/2+'px solid transparent');
//Makes Redirect containers height
$('.redirect-placeholder a').height($('.redirect-placeholder a').width()/2);
}
function tabletOrMobile() {
if(window.navigator.userAgent.match(/Mobile/i)
|| window.navigator.userAgent.match(/iPhone/i)
|| window.navigator.userAgent.match(/iPod/i)
|| window.navigator.userAgent.match(/IEMobile/i)
|| window.navigator.userAgent.match(/Windows Phone/i)
|| window.navigator.userAgent.match(/Android/i)
|| window.navigator.userAgent.match(/BlackBerry/i)
|| window.navigator.userAgent.match(/webOS/i)) {
return true;
//alert('True - Mobile - ' + navigator.userAgent);
} else {
//alert('False - Mobile - ' + navigator.userAgent);
//return false;
}
if(window.navigator.userAgent.match(/Tablet/i)
|| window.navigator.userAgent.match(/iPad/i)
|| window.navigator.userAgent.match(/Nexus 7/i)
|| window.navigator.userAgent.match(/Nexus 10/i)
|| window.navigator.userAgent.match(/KFAPWI/i)) {
return true;
//alert('True - Tablet - ' + navigator.userAgent);
}
if($('body').width() <= 500){
return true;
}
else {
//alert('False - Tablet - ' + navigator.userAgent);
//return false;
}
}