Files
grzanieplus.pl/apps/frontend/templates/theme/bianco/_script_theme.html
2025-03-12 17:06:23 +01:00

115 lines
3.3 KiB
HTML

{literal}
<!--[if IE 9]>
<style type="text/css">
select.form-control
{
padding-right: 0;
background-image: none;
}
</style>
<![endif]-->
<script type="text/javascript">
//<![CDATA[
jQuery(function($) {
var menuHeight = $('#header-navbar').height();
var dropdown = $('#nav-menu .dropdown-menu');
var dropdownSettings = $('#nav-settings .dropdown-menu');
function menuFix() {
if ($(window).width() > 768) {
var scrolled = $(window).scrollTop();
var menuTop = $('#header-navbar-position').offset().top;
var windowHeight = $(window).height();
var headerHeight = $('#header').outerHeight();
if (scrolled > menuTop) {
$('#header-navbar').addClass('navbar-fixed-top');
$('#header-navbar-position').css('min-height', menuHeight - 1);
dropdown.css('max-height', windowHeight - menuHeight - 15);
dropdownSettings.css('max-height', windowHeight - menuHeight - 15 - 48);
} else if (scrolled < menuTop) {
$('#header-navbar').removeClass('navbar-fixed-top');
$('#header-navbar-position').css('min-height', '');
dropdown.css('max-height', windowHeight - headerHeight - menuHeight - 15);
dropdownSettings.css('max-height', windowHeight - headerHeight - menuHeight - 15 - 48);
};
} else {
dropdown.removeAttr("style");
};
}
$(document).ready(function(){
$('body [data-equalizer]').equalizer({ use_tallest: true });
$(window).scroll(function () {
if ($(this).scrollTop() > 200) {
$('#toTopNew').addClass('show');
} else {
$('#toTopNew').removeClass('show');
}
});
$('#toTopNew').click(function () {
$("html, body").animate({
scrollTop: 0
}, 300);
return false;
});
$(window).load(function(){
setTimeout(function(){
if (($('#chat-application').length == 1) || ($('#livechat').length == 1) || ($('.fb_dialog_content iframe').length == 1)) {
$('#toTopNew').addClass('upper');
}
}, 500);
});
var scroll = false;
var $window = $(window);
$window.scroll(function() {
scroll = true;
});
setInterval(function() {
if (scroll) {
if($window.scrollTop() + $window.height() >= $(document).height()-250) {
$('#phone-call').addClass('show');
}else{
$('#phone-call').removeClass('show');
}
scroll = false;
}
}, 255);
$('#nav-button-search.collapsed').click(function() {
setTimeout(function(){
$('#nav-search .form-control').focus();
}, 300);
});
if ($('#nav-settings > ul > li:empty').length == 2)
{
$('#nav-button-settings').hide();
}
if ($(window).width() < 768) {
var windowHeightMobile = $(window).height();
var menuHeightMobile = $('#header-navbar').height();
$('#header-navbar .navbar-collapse').css('max-height', windowHeightMobile - menuHeightMobile);
};
menuFix();
});
$(window).scroll(function(){
menuFix();
});
$(window).resize(function(){
menuFix();
});
});
//]]>
</script>
{/literal}