1/* 2================================================================ 3* Template: iDocs - One Page Documentation HTML Template 4* Written by: Harnish Design - (http://www.harnishdesign.net) 5* Description: Main Custom Script File 6================================================================ 7*/ 8 9 10(function ($) { 11 "use strict"; 12 13// Preloader 14$(window).on('load', function () { 15 $('.lds-ellipsis').fadeOut(); // will first fade out the loading animation 16 $('.preloader').delay(333).fadeOut('slow'); // will fade out the white DIV that covers the website. 17 $('body').delay(333); 18}); 19 20/*------------------------------- 21 Primary Menu 22--------------------------------- */ 23 24// Dropdown show on hover 25$('.primary-menu ul.navbar-nav li.dropdown, .login-signup ul.navbar-nav li.dropdown').on("mouseover", function() { 26 if ($(window).width() > 991) { 27 $(this).find('> .dropdown-menu').stop().slideDown('fast'); 28 $(this).bind('mouseleave', function() { 29 $(this).find('> .dropdown-menu').stop().css('display', 'none'); 30 }); 31 } 32}); 33 34// When dropdown going off to the out of the screen. 35$('.primary-menu ul.navbar-nav .dropdown-menu').each(function() { 36 var menu = $('#header .container-fluid').offset(); 37 var dropdown = $(this).parent().offset(); 38 39 var i = (dropdown.left + $(this).outerWidth()) - (menu.left + $('#header .container-fluid').outerWidth()); 40 41 if (i > 0) { 42 $(this).css('margin-left', '-' + (i + 5) + 'px'); 43 } 44 }); 45$(function () { 46 $(".dropdown li").on('mouseenter mouseleave', function (e) { 47 if ($(window).width() > 991) { 48 var elm = $('.dropdown-menu', this); 49 var off = elm.offset(); 50 var l = off.left; 51 var w = elm.width(); 52 var docW = $(window).width(); 53 var isEntirelyVisible = (l + w + 30 <= docW); 54 if (!isEntirelyVisible) { 55 $(elm).addClass('dropdown-menu-right'); 56 } else { 57 $(elm).removeClass('dropdown-menu-right'); 58 } 59 } 60 }); 61}); 62 63// DropDown Arrow 64$('.primary-menu ul.navbar-nav').find('a.dropdown-toggle').append($('<i />').addClass('arrow')); 65 66 67// Mobile Collapse Nav 68$('.primary-menu .navbar-nav .dropdown-toggle[href="#"], .primary-menu .dropdown-toggle[href!="#"] .arrow').on('click', function(e) { 69 if ($(window).width() < 991) { 70 e.preventDefault(); 71 var $parentli = $(this).closest('li'); 72 $parentli.siblings('li').find('.dropdown-menu:visible').slideUp(); 73 $parentli.find('> .dropdown-menu').stop().slideToggle(); 74 $parentli.siblings('li').find('a .arrow.show').toggleClass('show'); 75 $parentli.find('> a .arrow').toggleClass('show'); 76 } 77}); 78 79 80// Mobile Menu 81$('.navbar-toggler').on('click', function() { 82 $(this).toggleClass('show'); 83}); 84 85 86/*------------------------ 87 Side Navigation 88-------------------------- */ 89 90$('#sidebarCollapse').on('click', function () { 91 $('#sidebarCollapse span:nth-child(3)').toggleClass('w-50'); 92 $('.idocs-navigation').toggleClass('active'); 93}); 94 95 96/*------------------------ 97 Sections Scroll 98-------------------------- */ 99 100$('.smooth-scroll,.idocs-navigation a').on('click', function() { 101 event.preventDefault(); 102 var sectionTo = $(this).attr('href'); 103 $('html, body').stop().animate({ 104 scrollTop: $(sectionTo).offset().top - 120}, 1000, 'easeInOutExpo'); 105}); 106 107/*----------------------------- 108 Magnific Popup 109------------------------------- */ 110 111// Image on Modal 112$('.popup-img').each(function() { 113$(this).magnificPopup({ 114 type: "image", 115 tLoading: '<div class="preloader"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></div>', 116 closeOnContentClick: !0, 117 mainClass: "mfp-fade", 118 119}); 120}); 121 122// YouTube/Viemo Video & Gmaps 123$('.popup-youtube, .popup-vimeo, .popup-gmaps').each(function() { 124$(this).magnificPopup({ 125 type: 'iframe', 126 mainClass: 'mfp-fade', 127}); 128}); 129 130 131/*------------------------ 132 Highlight Js 133-------------------------- */ 134 135hljs.initHighlightingOnLoad(); 136 137 138/*------------------------ 139 tooltips 140-------------------------- */ 141$('[data-toggle=\'tooltip\']').tooltip({container: 'body'}); 142 143 144/*------------------------ 145 Scroll to top 146-------------------------- */ 147$(function () { 148 $(window).on('scroll', function(){ 149 if ($(this).scrollTop() > 400) { 150 $('#back-to-top').fadeIn(); 151 } else { 152 $('#back-to-top').fadeOut(); 153 } 154 }); 155 }); 156$('#back-to-top').on("click", function() { 157 $('html, body').animate({scrollTop:0}, 'slow'); 158 return false; 159}); 160 161 162})(jQuery)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.