jQuery(document).ready(function () {
jQuery('#top-header .navbar-nav > li > a , #top-header .search-form-wrapper, #top-header .social-icon li a').css({'height': jQuery('#top-header .header-custom-logo').outerHeight(true)+'px', 'line-height': jQuery('#top-header .header-custom-logo').outerHeight(true)+'px'});
var hHeight = (jQuery('.header-fixed').outerHeight());
if(!hHeight){hHeight = 0;}
jQuery('html').css({'padding-top': hHeight});
new WOW().init();
jQuery('#menu').slicknav({
allowParentLinks:"true",
label: 'Menu'
});
/*
* Funtion for the bx slider
*
*/
jQuery('.bxslider').bxSlider({
mode: 'horizontal',
slideMargin: 3,
speed:1500,
infiniteLoop: true,
autoDirection: 'prev',
auto: true
});
/*
*
* Function for the Nivo slider
*/
jQuery('#slider').nivoSlider({
effect: 'boxRainGrowReverse',
animSpeed: 500,
pauseTime: 5000,
directionNav: false,
controlNav: false,
controlNavThumbs: false,
pauseOnHover: false,
manualAdvance: false,
randomStart: false
});
/*
* Function for create dynamic map
*
*/
jQuery("#map-address").each(function(){
var embed ="";
jQuery(this).html(embed);
});
jQuery("#map-address2").each(function(){
var embed ="";
jQuery(this).html(embed);
});
});
/*
* Function for the Sticky header
*
*/
jQuery(window).scroll(function () {
if(jQuery(window).scrollTop() == 0) {
jQuery("#top-header").removeClass("small-header");
}
else{
jQuery("#top-header").addClass("small-header");
}
});
jQuery(window).scroll(function () {
if(jQuery(window).scrollTop() == 0) {
jQuery("body-border").removeClass("bg-fixed");
}
else{
jQuery("body-border").addClass("bg-fixed");
}
});
jQuery(document).ready(function(){
jQuery(window).scroll(function () {
if(jQuery(window).scrollTop() == 0) {
jQuery("#logo-show-sm").removeClass("display-none");
}
else{
jQuery("#logo-show-sm").addClass("display-none");
}
});
/*
* Function for the Parallax image
*
*/
var $window = jQuery(window); //You forgot this line in the above example
jQuery('div[data-type="background"]').each(function(){
var $bgobj = jQuery(this); // assigning the object
jQuery(window).scroll(function() {
var yPos = -($window.scrollTop() / $bgobj.data('speed'));
// Put together our final background position
var coords = '50% '+ yPos + 'px';
// Move the background
$bgobj.css({ backgroundPosition: coords });
});
});
});