/*************************************************************************************************************** |||||||||||||||||||||||||||| custom script for assurance ||||||||||||||||||||||||||||||||||||| **************************************************************************************************************** |||||||||||||||||||||||||||| table of content |||||||||||||||||||||||||||||||||||| **************************************************************************************************************** **************************************************************************************************************** 01. revolution slider 02. sticky header 03. scoll to top 04. project masonary 06. testimonial slider 07. magnificpopup 08. fact counter 09. prealoder 10. contactformvalidation 11. services-select **************************************************************************************************************** |||||||||||||||||||||||||||| end table of content |||||||||||||||||||||||||||||||||||| ****************************************************************************************************************/ "use strict"; /*---------------------------- preloader ------------------------------ */ function prealoader () { if($('.loader-container').length) { $('.loader-container').fadeout(1000); } } /*=================== sticky header ===================*/ function stickyheader () { var scroll = $(window).scrolltop(); if (scroll > 200) { $(".mainmenu-area.stick, .header-lower.stick, .header-area.stick").addclass("sticky animated fadeindown"); var nav_height = $(".mainmenu-area.stick, .header-lower.stick, .header-area.stick").innerheight(); $(".menu-height").css({ "height": nav_height }); } else if (scroll < 200) { $(".mainmenu-area.stick, .header-lower.stick, .header-area.stick").removeclass("sticky animated fadeindown"); $(".menu-height").css({ "height": 0 }); } } //====main menu=== function mainmenu() { //submenu dropdown toggle if($('.main-menu li.dropdown ul').length){ $('.main-menu li.dropdown').append(''); //dropdown button $('.main-menu li.dropdown .dropdown-btn').click(function() { $(this).prev('ul').slidetoggle(500); }); } } //===revolutionslideractiver=== function revolutionslideractiver () { if ($('.rev_slider_wrapper #slider1').length) { $("#slider1").revolution({ slidertype:"standard", sliderlayout:"auto", delay:5000, navigationtype:"bullet", navigationarrows:"0", navigationstyle:"preview3", dottedoverlay:'yes', hidetimerbar:"off", onhoverstop:"off", navigation: { arrows:{enable:true} }, responsivelevels:[1920,1280,975,600,300], gridwidth: [1170, 720, 500, 500, 300], gridheight: [650, 600, 550, 450, 400] }); }; } //===scoll to top=== function scrolltotop() { if ($('.scroll-to-target').length) { $(".scroll-to-target").click(function() { var target = $(this).attr('data-target'); // animate $('html, body').animate({ scrolltop: $(target).offset().top }, 1000); }); } } //===testmonial slider style 2=== function testimcarousel () { if ($('.testim-carousel').length) { $('.testim-carousel').owlcarousel({ loop:true, margin:30, nav:false, dots: false, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:2 }, 1024:{ items:2 }, 1100:{ items:3 }, 1200:{ items:3 } } }) } } //===testmonial slider style 2=== function clientscarousel () { if ($('.clients-carousel').length) { $('.clients-carousel').owlcarousel({ loop:true, margin:30, nav:true, dots: true, items:1, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1100:{ items:1 }, 1200:{ items:1 } } }) } } //===testmonial slider style 2=== function clientsstyletwocarousel () { if ($('.clients-style-two-carousel').length) { $('.clients-style-two-carousel').owlcarousel({ loop:true, margin:30, dots: false, items:1, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, navigation: true, navigationtext: ["", ""], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1100:{ items:1 }, 1200:{ items:1 } } }) } } //===testmonial slider style 2=== function teamcarousal () { if ($('.team-carousel').length) { $('.team-carousel').owlcarousel({ loop:true, margin:30, nav:true, dots: false, items:1, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1100:{ items:1 }, 1200:{ items:1 } } }) } } //===team carousal=== function teamtopcarousal () { if ($('.teamtop-carousal').length) { $('.teamtop-carousal').owlcarousel({ loop:true, margin:30, nav:false, dots: false, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:2 }, 1024:{ items:2 }, 1100:{ items:3 }, 1200:{ items:3 } } }) } } //===sponser slider style 2=== function sponsercarousel () { if ($('.sponser-carousel').length) { $('.sponser-carousel').owlcarousel({ loop:true, margin:30, nav:false, dots: false, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 800:{ items:3 }, 1024:{ items:4 }, 1100:{ items:4 }, 1200:{ items:4 } } }) } } //===testmonial slider style 2=== function bannercarousel () { if ($('.banner-carousel').length) { $('.banner-carousel').owlcarousel({ loop:true, margin:30, nav:true, dots: true, items:1, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, transitionstyle : "fadeindown", responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1100:{ items:1 }, 1200:{ items:1 } } }) } } //===testmonial slider style 3=== function bannerthreecarousel () { if ($('.banner-three-carousel').length) { $('.banner-three-carousel').owlcarousel({ loop:true, margin:0, nav:true, dots: true, items:3, autoplayhoverpause:true, autoplay: 6000, smartspeed: 700, transitionstyle : "fadeindown", responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:2 }, 1024:{ items:3 }, 1100:{ items:3 }, 1200:{ items:3 } } }) } } /*--------------------magnificpopup------------------*/ function magnificpopup () { if($(".video").is("#video")){ var videoplay = $('.video-play'); videoplay.magnificpopup({ type: 'iframe', closebtninside: false, closeoncontentclick: true, tloading: '', // remove text from preloader }); } } //===search box === function searchbox() { //search box toggle if($('.search-toggle').length){ //dropdown button $('.search-toggle').click(function() { $(this).toggleclass('active'); $(this).next('.search-box').toggleclass('now-visible'); }); } } $('.toggle').click(function(e) { e.preventdefault(); var $this = $(this); if ($this.next().hasclass('show')) { $this.next().removeclass('show'); $this.next().slideup(350); } else { $this.parent().parent().find('li .inner').removeclass('show'); $this.parent().parent().find('li .inner').slideup(350); $this.next().toggleclass('show'); $this.next().slidetoggle(350); } }); /*=================== accordion ===================*/ function accordion () { $(".toggle").each(function(){ $(this).find('.content').hide(); $(this).find('h2:first').addclass('active').next().slidedown(500).parent().addclass("activate"); $('h2', this).click(function() { if ($(this).next().is(':hidden')) { $(this).parent().parent().find("h2").removeclass('active').next().slideup(500).removeclass('animated fadeinup').parent().removeclass("activate"); $(this).toggleclass('active').next().slidedown(500).addclass('animated fadeinup').parent().toggleclass("activate"); } }); }); } //=== fact counter === function counternumberchanger () { var timer = $('.timer'); if(timer.length) { timer.appear(function () { timer.countto(); }) } } //=== select menu === function selectdropdown () { if($(".selectmenu").length) { $( ".selectmenu" ).selectmenu(); }; } //=== thm scroll anim=== function thmscrollanim() { if ($('.wow').length) { var wow = new wow({ mobile: false }); wow.init(); }; } // ===project=== function projectmasonarylayout() { if ($('.masonary-layout').length) { $('.masonary-layout').isotope({ layoutmode: 'masonry' }); } if ($('.post-filter').length) { $('.post-filter li').children('span').click(function() { var self = $(this); var selector = self.parent().attr('data-filter'); $('.post-filter li').children('span').parent().removeclass('active'); self.parent().addclass('active'); $('.filter-layout').isotope({ filter: selector, animationoptions: { duration: 500, easing: 'linear', queue: false } }); return false; }); } if ($('.post-filter.has-dynamic-filter-counter').length) { // var allitem = $('.single-filter-item').length; var activefilteritem = $('.post-filter.has-dynamic-filter-counter').find('li'); activefilteritem.each(function() { var filterelement = $(this).data('filter'); console.log(filterelement); var count = $('.gallery-content').find(filterelement).length; $(this).children('span').append('' + count + ''); }); }; } // ===date picker === function datepicker () { if ($('#datepicker').length) { $('#datepicker').datepicker(); }; } // in your javascript (external .js resource or