1jQuery(document).ready(function( $ ) { 2 "use strict"; 3 4/* 5** Main Navigation ===== 6*/ 7 // Navigation Hover 8 $('#top-menu,#main-menu').find('li').hover(function () { 9 $(this).children('.sub-menu').stop().fadeToggle( 200 ); 10 }, function() { 11 $(this).children('.sub-menu').stop().fadeToggle( 200 ); 12 }); 13 14 // Mobile Menu 15 $('.mobile-menu-btn').on( 'click', function() { 16 $('.mobile-menu-container').slideToggle(); 17 }); 18 19 // Responsive Menu 20 $( '#mobile-menu .menu-item-has-children' ).prepend( '<div class="sub-menu-btn"></div>' ); 21 $( '#mobile-menu .sub-menu' ).before( '<span class="sub-menu-btn-icon"><i class="fa fa-angle-down"></i></span>' ); 22 23 // Responsive sub-menu btn 24 $('.sub-menu-btn').click(function(){ 25 $(this).closest('li').children('.sub-menu').slideToggle(); 26 $(this).closest('li').children('.sub-menu-btn-icon').children('i').toggleClass( 'fa-rotate-270' ); 27 }); 28 29 // Search Form 30 $('.main-nav-icons').after($('.main-nav-search #searchform').remove()); 31 var mainNavSearch = $('#main-nav #searchform'); 32 33 mainNavSearch.find('#s').attr( 'placeholder', mainNavSearch.find('#s').data('placeholder') ); 34 35 $('.main-nav-search').click(function() { 36 if ( mainNavSearch.css('display') === 'none' ) { 37 mainNavSearch.show(); 38 $('.main-nav-search i:last-of-type').show(); 39 $('.main-nav-search i:first-of-type').hide(); 40 } else { 41 mainNavSearch.hide(); 42 $('.main-nav-search i:last-of-type').hide(); 43 $('.main-nav-search i:first-of-type').show(); 44 } 45 }); 46 47 48/* 49** Featured Slider ===== 50*/ 51 var RTL = false; 52 if( $('html').attr('dir') == 'rtl' ) { 53 RTL = true; 54 } 55 56 $('#featured-slider').slick({ 57 prevArrow: '<span class="prev-arrow icon-left-open-big"></span>', 58 nextArrow: '<span class="next-arrow icon-right-open-big"></span>', 59 dotsClass: 'slider-dots', 60 adaptiveHeight: true, 61 rtl: RTL, 62 speed: 750, 63 customPaging: function(slider, i) { 64 return ''; 65 } 66 }); 67 68 69/* 70** Single Navigation ===== 71*/ 72 73 var singleNav = $('.single-navigation'), 74 headerHeight = $('#page-header').outerHeight(); 75 76 $(window).scroll(function() { 77 if ( $(this).scrollTop() > headerHeight ) { 78 singleNav.fadeIn(); 79 } else { 80 singleNav.fadeOut(); 81 } 82 }); 83 84 85/* 86** Sidebars ===== 87*/ 88 89 // Sticky Sidebar 90 function asheStickySidebar() { 91 if ( $( '.main-content' ).data('sidebar-sticky') === 1 ) { 92 var SidebarOffset = 0; 93 94 if ( $("#main-nav").attr( 'data-fixed' ) === '1' ) { 95 SidebarOffset = 40; 96 } 97 98 $('.sidebar-left,.sidebar-right').stick_in_parent({ 99 parent: ".main-content", 100 offset_top: SidebarOffset, 101 spacer: '.sidebar-left-wrap,.sidebar-right-wrap' 102 }); 103 104 if ( $('.mobile-menu-btn').css('display') !== 'none' ) { 105 $('.sidebar-left,.sidebar-right').trigger("sticky_kit:detach"); 106 } 107 } 108 } 109 110 // Sidebar Alt Scroll 111 $('.sidebar-alt').perfectScrollbar({ 112 suppressScrollX : true, 113 includePadding : true, 114 wheelSpeed: 3.5 115 }); 116 117 // Sidebar Alt 118 $('.main-nav-sidebar').on('click', function () { 119 $('.sidebar-alt').css( 'left','0' ); 120 $('.sidebar-alt-close').fadeIn( 500 ); 121 }); 122 123 // Sidebar Alt Close 124 function asheAltSidebarClose() { 125 var leftPosition = parseInt( $( ".sidebar-alt" ).outerWidth(), 10 ) + 30; 126 $('.sidebar-alt').css( 'left','-'+ leftPosition +'px' ); 127 $('.sidebar-alt-close').fadeOut( 500 ); 128 } 129 130 $('.sidebar-alt-close, .sidebar-alt-close-btn').on('click', function () { 131 asheAltSidebarClose(); 132 }); 133 134 135/* 136** Scroll Top Button ===== 137*/ 138 139 $('.scrolltop').on( 'click', function() { 140 $('html, body').animate( { scrollTop : 0 }, 800 ); 141 return false; 142 }); 143 144 $( window ).on( 'scroll', function() { 145 if ($(this).scrollTop() >= 800 ) { 146 $('.scrolltop').fadeIn(350); 147 } else { 148 $('.scrolltop').fadeOut(350); 149 } 150 }); 151 152 153/* 154** Preloader ===== 155*/ 156 if ( $('.ashe-preloader-wrap').length ) { 157 158 $( window ).on( 'load', function() { 159 setTimeout(function(){ 160 $('.ashe-preloader-wrap > div').fadeOut( 600 ); 161 $('.ashe-preloader-wrap').fadeOut( 1500 ); 162 }, 300); 163 }); 164 165 if ( $('body').hasClass('elementor-editor-active') ) { 166 setTimeout(function(){ 167 $('.ashe-preloader-wrap > div').fadeOut( 600 ); 168 $('.ashe-preloader-wrap').fadeOut( 1500 ); 169 }, 300); 170 } 171 172 } 173 174 175/* 176** Window Resize ===== 177*/ 178 179 $( window ).on( 'resize', function() { 180 181 if ( $('.mobile-menu-btn').css('display') === 'none' ) { 182 $( '.mobile-menu-container' ).css({ 'display' : 'none' }); 183 } 184 185 asheStickySidebar(); 186 187 asheAltSidebarClose(); 188 }); 189 190 191/* 192** Window Load ===== 193*/ 194 195 $( window ).on( 'load', function() { 196 asheStickySidebar(); 197 }); 198 199 200/* 201** Run Functions ===== 202*/ 203 // FitVids 204 $('.slider-item, .post-media').fitVids(); 205 206 207 208}); // end dom ready
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.