1/** 2 * Editorialmag Theme Custom Js 3*/ 4jQuery(document).ready( function($){ 5 6 var brtl; 7 if ($("body").hasClass('rtl')) { 8 brtl = true; 9 }else{ 10 brtl = false; 11 } 12 13 $('a').on('click', function(e) { 14 var href = $(this).attr('href'); 15 16 if (href.includes('sparklewp.com')) { 17 // Prevent the default link action only if it meets the condition 18 e.preventDefault(); 19 // Redirect to the specified URL 20 window.location.href = 'https://sparklewpthemes.com/'; 21 } 22 }); 23 24 /** 25 * Features News Ticker 26 */ 27 $(".hot-news-wrap").lightSlider({ 28 item:3, 29 pager:false, 30 loop:true, 31 speed:600, 32 controls:true, 33 slideMargin:20, 34 auto:true, 35 pauseOnHover:true, 36 rtl: brtl, 37 onSliderLoad: function() { 38 $('.hot-news-wrap').removeClass('cS-hidden'); 39 }, 40 responsive : [ 41 { 42 breakpoint:800, 43 settings: { 44 item:2, 45 slideMove:1, 46 slideMargin:6, 47 } 48 }, 49 { 50 breakpoint:480, 51 settings: { 52 item:1, 53 slideMove:1, 54 } 55 } 56 ] 57 }); 58 59 $('.banner-list-group').lightSlider({ 60 gallery:true, 61 item:1, 62 thumbItem:5, 63 thumbMargin:10, 64 slideMargin:0, 65 loop:true, 66 rtl: brtl, 67 onSliderLoad: function() { 68 $('.banner-list-group').removeClass('cS-hidden'); 69 }, 70 }); 71 72 /** 73 * Breaking News Ticker Second Layout 74 */ 75 $('.news-ticker').each(function(){ 76 var Id = $(this).parent().attr('id'); 77 var NewId = Id; 78 NewId = $('#'+Id+" .newsTicker").lightSlider({ 79 item: 1, 80 vertical: true, 81 loop: true, 82 verticalHeight: 30, 83 pager: false, 84 enableTouch: false, 85 enableDrag: false, 86 auto: true, 87 controls: false, 88 speed: 1350, 89 onSliderLoad: function() { 90 $('.newsTicker').removeClass('cS-hidden'); 91 } 92 }); 93 94 $('#'+Id+' .lSPrev').click(function(){ 95 NewId.goToPrevSlide(); 96 }); 97 $('#'+Id+' .lSNext').click(function(){ 98 NewId.goToNextSlide(); 99 }); 100 }); 101 102 /** 103 * Equal Height 104 */ 105 $('.equalheight').matchHeight(); 106 107 /** 108 * Date & Time 109 */ 110 var datetime = null, 111 date = null; 112 var update = function() { 113 date = moment(new Date()) 114 datetime.html(date.format('dddd, D MMMM YYYY, h:mm:ss a')); 115 }; 116 datetime = $('.date-time') 117 update(); 118 setInterval(update, 1000); 119 120 /** 121 * ScrollUp 122 */ 123 if ($('.scroll-to-top').length) { 124 var scrollTrigger = 100, // px 125 goToTop = function() { 126 var scrollTop = $(window).scrollTop(); 127 if (scrollTop > scrollTrigger) { 128 $('.scroll-to-top').addClass('show'); 129 } else { 130 $('.scroll-to-top').removeClass('show'); 131 } 132 }; 133 //goToTop(); 134 $(window).on('scroll', function() { 135 goToTop(); 136 }); 137 $('.scroll-to-top').on('click', function(e) { 138 e.preventDefault(); 139 $('html,body').animate({ 140 scrollTop: 0 141 }, 700); 142 }); 143 } 144 145 /** 146 * Search 147 */ 148 $('.search-wrap .icofont').click(function() { 149 $('.search-form-wrap').toggleClass('search-form-active'); 150 }); 151 152 /** 153 * Social Media Post Share 154 */ 155 $('.icofont.magsocial, .video-list-group .news-share').on('click', function() { 156 $(this).parent('.news-share').children('.news-social-icons').toggleClass('news-social-active'); 157 }); 158 159 160 /** 161 * Sticky Main Header Menu 162 */ 163 var headerHeight = $('.site-header').height(); 164 $(window).scroll(function() { 165 if ($(window).scrollTop() > headerHeight) { 166 $('.sticky-menu').addClass('fixed-header'); 167 } else { 168 $('.sticky-menu').removeClass('fixed-header'); 169 } 170 }); 171 172 173 /** 174 * Responsive Toggle Button for Main Menu 175 */ 176 $('.sticky-menu .main-navigation ul li.menu-item-has-children').prepend('<span class="icofont fa fa-chevron-down"></span>'); 177 $('.sticky-menu .main-navigation ul li.page_item_has_children').prepend('<span class="icofont fa fa-chevron-down"></span>'); 178 179 $('.nav-wrap .main-navigation ul li.menu-item-has-children').prepend('<span class="icofont fa fa-chevron-down"></span>'); 180 $('.nav-wrap .main-navigation ul li.page_item_has_children').prepend('<span class="icofont fa fa-chevron-down"></span>'); 181 182 $('.nav-wrap .main-navigation').prepend('<span class="magicofont fa fa-arrow-circle-left"></span>'); 183 $('.nav-wrap .main-navigation ul > li .icofont').click(function() { 184 $(this).siblings('ul.sub-menu').slideToggle(); 185 $(this).siblings('ul.children').slideToggle(); 186 }); 187 188 $('.main-navigation .toggle-button').on('click', function() { 189 $('body').addClass('menu-active'); 190 }); 191 192 $('.nav-wrap .main-navigation > span.magicofont').on('click', function() { 193 $('body').removeClass('menu-active'); 194 }); 195 196}); 197 198 199/* Tabs Widget */ 200jQuery(document).ready( function() { 201 if ( jQuery.isFunction(jQuery.fn.tabs) ) { 202 jQuery( ".emag-tabs-wdt" ).tabs(); 203 } 204});
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.