//Gallery js
const gridify = new Gridify();
const container = document.querySelector('.grid');
container.addEventListener('gridify:init', (ev) => {
}, false);
container.addEventListener('gridify:resized', (ev) => {
console.log('Resized handler');
}, false);
(function() {
jQuery(document).on("click", ".click-to-expand", function() {
var imageSrc = jQuery(this).parents(".image-grid").find("img").attr("src");
jQuery(".js-modal-image").attr("src", imageSrc);
});
})();
//wow js
jQuery(document).ready(function($){wow=new WOW({boxClass:'wow',animateClass:'animated',offset:0,mobile:!0,live:!0})
wow.init()})
jQuery(document).ready(function () {
jQuery(document).on('click', '.navbar-toggler', function () {
jQuery(this).toggleClass('active')
})
});
jQuery(document).ready(function(){
// Add minus icon for collapse element which is open by default
jQuery(".collapse.show").each(function(){
jQuery(this).prev(".fs-accordion-head").find(".fa").addClass("fa-minus").removeClass("fa-plus");
});
// Toggle plus minus icon on show hide of collapse element
jQuery(".collapse").on('show.bs.collapse', function(){
jQuery(this).prev(".fs-accordion-head").find(".fa").removeClass("fa-plus").addClass("fa-minus");
}).on('hide.bs.collapse', function(){
jQuery(this).prev(".fs-accordion-head").find(".fa").removeClass("fa-minus").addClass("fa-plus");
});
});
// Why Choose Us section video js
jQuery(document).ready(function() {
// Gets the video src from the data-src on each button
var $videoSrc;
jQuery('.video-btn').click(function() {
$videoSrc = jQuery(this).data( "src" );
});
// modal opn autoplay start
jQuery('#fs-modal').on('shown.bs.modal', function (e) {
// set the video src to autoplay and not to show related video. Youtube related video is like a box of chocolates... you never know what you're gonna get
jQuery("#fs-video").attr('src',$videoSrc + "?autoplay=1&modestbranding=1&showinfo=0" );
})
// stop auto play
jQuery('#fs-modal').on('hide.bs.modal', function (e) {
// a poor man's stop video
jQuery("#fs-video").attr('src',$videoSrc);
})
});
// Counter js //
jQuery(window).scroll(startCounter);
function startCounter() {
if(jQuery('.fs-counter-inner').length > 0)
{
var hT = jQuery('.fs-counter-inner').offset().top,
hH = jQuery('.fs-counter-inner').outerHeight(),
wH = jQuery(window).height();
if (jQuery(window).scrollTop() > hT+hH-wH) {
jQuery(window).off("scroll", startCounter);
jQuery('.counter-number').each(function () {
var $this = jQuery(this);
jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
duration: 6000,
easing: 'swing',
step: function () {
$this.text(Math.ceil(this.Counter) + '');
}
});
});
}
}
}
jQuery(document).ready(function(){
//Image popup
// .portfolio_items, .treatment_gallery_main,
jQuery('.fs-gallery-inner').magnificPopup({
delegate: 'a.image_popup',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: 'The image #%curr% could not be loaded.',
titleSrc: function(item) {
//return item.el.attr('title') + 'by Marsel Van Oosten';
}
}
});
});
// Slide show animation
/*Scroll to top when arrow up clicked BEGIN*/
jQuery(window).scroll(function() {
var height = jQuery(window).scrollTop();
if (height > 100) {
jQuery('.fs-scroll').fadeIn();
} else {
jQuery('.fs-scroll').fadeOut();
}
});
jQuery(document).ready(function() {
jQuery(".fs-scroll").click(function(event) {
event.preventDefault();
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
});
//sticky navbar
jQuery(window).on("scroll",function(a){
190