1/** 2* 3* -------------------------------------------------------------------- 4* 5* Template : Industrie â Industry & Factory WordPress Theme 6* Author : rs-theme 7* Author URI : http://www.rstheme.com 8* 9* -------------------------------------------------------------------- 10* 11**/ 12 13(function($) { 14 "use strict"; 15 // sticky menu 16 17 if ($('.rs-enable-sticky').length) { 18 window.onscroll = function() {myFunction()}; 19 var header = document.getElementById( "rs-header" ); 20 21 $(window).on( 'load', function() { 22 var rschild_height = $('#rs-header header.elementor-element').outerHeight(); 23 $('#rs-header div.elementor').css('margin-top', rschild_height + 'px'); 24 }); 25 26 function myFunction() { 27 if ( window.pageYOffset > 50 ) { 28 header.classList.add( "rs-header-sticky" ); 29 } else { 30 header.classList.remove( "rs-header-sticky" ); 31 } 32 } 33 } 34 35 if($().niceScroll){ 36 if ($(window).width() > 991) { 37 $('body, html').addClass('rs-scrollbar'); 38 $("body").niceScroll({ 39 cursorcolor: scroll_data.cursorcolor, 40 horizrailenabled:false, 41 cursorwidth: scroll_data.cursor_width, 42 cursorminheight: scroll_data.cursorminheight, 43 scrollspeed: scroll_data.scrollspeed, 44 mousescrollstep: scroll_data.mousescrollstep, 45 autohidemode: 'false', 46 cursorborder: "0px solid #fff", // css definition for cursor border 47 cursorborderradius: "0px", // border radius in pixel for cursor 48 background: scroll_data.rail_bg, 49 overflowy: 'false' 50 }); 51 } 52 } 53 54 $(".widget_nav_menu li a").filter(function(){ 55 return $.trim($(this).html()) == ''; 56 }).hide(); 57 58 // Copyright Get The Live Year 59 var $currentYearElement = $("#current-year"); 60 if ($currentYearElement.length > 0) { 61 var cprcurrentYear = new Date().getFullYear(); 62 $currentYearElement.text(cprcurrentYear); 63 setInterval(function() { 64 var cprupdatedYear = new Date().getFullYear(); 65 if (cprupdatedYear !== cprcurrentYear) { 66 $currentYearElement.text(cprupdatedYear); 67 cprcurrentYear = cprupdatedYear; 68 } 69 }, 1000); 70 } 71 72 $(".menu-area .navbar ul > li.menu-item-has-children").on('hover',function () { 73 $(this).addClass('hover-minimize'); 74 }, 75 function () { 76 $(this).removeClass("hover-minimize"); 77 } 78 ); 79 80 //search 81 $('.search_icons').on('click', function(event) { 82 $('.rs_stickys_form').slideToggle('show'); 83 $(this).toggleClass('icon_close'); 84 }); 85 86 $('.sticky_search').on('click', function() { 87 $('body').removeClass('search-active').removeClass('search-close'); 88 if ($(this).hasClass('close-full')) { 89 $('body').addClass('search-close'); 90 } 91 else { 92 $('body').addClass('search-active'); 93 } 94 return false; 95 }); 96 97 $('.nav-link-container').on('click', function(e){ 98 $('body.on-offcanvas').removeClass('on-offcanvas'); 99 setTimeout(function(){ $('body').addClass('on-offcanvas'); },500); 100 }); 101 102 $('.sticky_form_search').on('click', function() { 103 $('body, html').removeClass('rs-search-active').removeClass('rs-search-close'); 104 if ($(this).hasClass('close-search')) { 105 $('body, html').addClass('rs-search-close'); 106 107 } 108 else { 109 $('body, html').addClass('rs-search-active'); 110 } 111 return false; 112 }); 113 114 $("#rs-header ul > li.classic").on('hover', 115 function () { 116 $('body').addClass('mega-classic'); 117 }, 118 function () { 119 $('body.mega-classic').removeClass("mega-classic"); 120 } 121 ); 122 123 // Canvas Menu Js 124 $( ".nav-link-container > a" ).off("click").on("click", function(event){ 125 event.preventDefault(); 126 }); 127 128 // Get a quote popup 129 $('.popup-quote').magnificPopup({ 130 type: 'inline', 131 preloader: false, 132 focus: '#qname', 133 removalDelay: 500, //delay removal by X to allow out-animation 134 // When elemened is focused, some mobile browsers in some cases zoom in 135 // It looks not nice, so we disable it: 136 callbacks: { 137 beforeOpen: function() { 138 this.st.mainClass = this.st.el.attr('data-effect'); 139 if($(window).width() < 700) { 140 this.st.focus = false;
141 } else { 142 this.st.focus = '#qname'; 143 } 144 } 145 } 146 }); 147 148 // Magnific Popup Box 149 var rsaddon_PRObox = $('.rsaddon_pro_box'); 150 if(rsaddon_PRObox.length) { 151 $('.rsaddon_pro_box').magnificPopup({ 152 delegate: '.pointer-events', 153 removalDelay: 500, 154 callbacks: { 155 beforeOpen: function() { 156 this.st.mainClass = this.st.el.attr('data-effect'); 157 } 158 }, 159 midClick: true 160 }); 161 } 162 163 // Portfolio Single Carousel 164 if ($('.portfolio-carousel').length) { 165 $('.portfolio-carousel').owlCarousel({ 166 loop: true, 167 nav:true, 168 autoHeight:true, 169 items:1 170 }) 171 } 172 173 // blog init 174 $(".blog-carousel").each(function() { 175 var options = $(this).data('carousel-options'); 176 $(this).owlCarousel(options); 177 }); 178 179 $(".rs-products-grid .product-btn .button").addClass("glyph-icon ri-shopping-bag-line"); 180 181 //Videos popup jQuery activation code 182 $('.popup-videos, .popup-border').magnificPopup({ 183 disableOn: 10, 184 type: 'iframe', 185 mainClass: 'mfp-fade', 186 removalDelay: 160, 187 preloader: false, 188 189 fixedContentPos: false 190 }); 191 192 // collapse hidden 193 $(function(){ 194 var navMain = $(".navbar-collapse"); 195 navMain.on("click", "a:not([data-toggle])", null, function () { 196 navMain.collapse('hide'); 197 }); 198 }); 199 200 //Select box wrap css 201 $(".menu-area .navbar ul > li.mega > ul.sub-menu").wrapInner("<div class='container flex-mega'></div>"); 202 $('.menu-area .navbar ul > li.mega > ul.sub-menu li').first().addClass('first-li-item'); 203 204 205 if ($('div').hasClass('openingfoot')) { 206 $('body').addClass('openingfootwrap'); 207 } 208 209 if ($('nav').hasClass('absolute-position')) { 210 $('header.elementor-section').addClass('absolute-header'); 211 } 212 213 if ($('body').hasClass('page-template-page-single2')) { 214 $('body').addClass('page-template-page-single page-template-page-single-php'); 215 } 216 //preloader 217 $(window).on( 'load', function() { 218 $("#pre-load").delay(600).fadeOut(500); 219 $(".pre-loader").delay(600).fadeOut(500); 220 221 if($(window).width() < 992) { 222 $('.rs-menu').css('height', '0'); 223 $('.rs-menu').css('opacity', '0'); 224 $('.rs-menu').css('z-index', '-1'); 225 $('.rs-menu-toggle').on( 'click', function(){ 226 $('.rs-menu').css('opacity', '1'); 227 $('.rs-menu').css('z-index', '1'); 228 }); 229 } 230 }); 231 232 /*image loaded portfolio init*/ 233 if ($('.grid').length) { 234 $('.grid').imagesLoaded(function() { 235 $('.portfolio-filter').on('click', 'button', function() { 236 var filterValue = $(this).attr('data-filter'); 237 $grid.isotope({ 238 filter: filterValue 239 }); 240 }); 241 var $grid = $('.grid').isotope({ 242 243 animationOptions: { 244 duration: 750, 245 easing: 'linear', 246 queue: false 247 }, 248 249 itemSelector: '.grid-item', 250 percentPosition: true, 251 masonry: { 252 columnWidth: '.grid-item', 253 } 254 }); 255 }); 256 } 257 258 // Team Social Icon Collaps Button 259 $('.team_social_collaps_btn').on('click',function() { 260 $(this).parents('.team-inner-wrap').toggleClass('is-open') 261 }); 262 263 // portfolio Filter 264 $('.portfolio-filter button').on('click', function(event) { 265 $(this).siblings('.active').removeClass('active'); 266 $(this).addClass('active'); 267 event.preventDefault(); 268 }); 269 270 // magnificPopup init 271 $('.image-popup').magnificPopup({ 272 type: 'image', 273 callbacks: { 274 beforeOpen: function() { 275 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure animated zoomInDown'); 276 } 277 }, 278 image: { 279 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 280 titleSrc: function(item) { 281 return '<div class="gallery-title-wrap"><h3>' + item.el.attr('title') + '</h3>' + '<p>' + item.el.attr('caption') + '</p></div>'; 282 } 283 }, 284 gallery: { 285 enabled: true 286 } 287 }); 288 289 // scrollTop init 290 var win=$(window); 291 var totop = $('#scrollUp'); 292 win.on('scroll', function() { 293 if (win.scrollTop() > 150) { 294 totop.fadeIn(); 295 } else { 296 totop.fadeOut(); 297 } 298 }); 299 totop.on('click', function() { 300 $("html,body").animate({ 301 scrollTop: 0 302 }, 500) 303 }); 304 305 $( ".comment-body, .comment-respond" ).wrap( "<div class='comment-full'></div>" ); 306 $( ".wpcf7-form-control.wpcf7-select" ).wrapAll( "<em class='select-full'></em>" ); 307 $('.rs-heading .description p:empty').remove(); 308 $( ".woocommerce-product-gallery, .summary.entry-summary" ).wrapAll( "<div class='rs-wrap-summery'></div>" ); 309 $( ".form-row.form-row-first, .form-row.form-row-last" ).wrapAll( "<div class='rs-wrap-coupon'></div>" ); 310 $( "ul.children" ).addClass( "sub-menu" ); 311 $(".blog .rs-blog .blog-item, .archive .rs-blog .blog-item").last().addClass("last--child"); 312 $('.popup-text-video').addClass('expand'); 313 314 // mobile Menu 315 $('.menu-wrap-off a').each(function(){ 316 var href = $(this).attr("href"); 317 if(href == "#"){ 318 $(this).addClass('hash'); 319 }else{ 320 $(this).removeClass('hash'); 321 } 322 }); 323 324 325 $.fn.menumaker = function(options) { 326 var mobile_menu = $(this), settings = $.extend({ 327 format: "dropdown",
328 sticky: false 329 }, options); 330 331 return this.each(function() { 332 mobile_menu.find('li ul').parent().addClass('has-sub'); 333 var multiTg = function() { 334 mobile_menu.find(".has-sub").prepend('<span class="submenu-button"></span>'); 335 mobile_menu.find(".hash").parent().addClass('hash-has-sub'); 336 mobile_menu.find('.submenu-button').on('click', function() { 337 $(this).toggleClass('submenu-opened'); 338 if ($(this).siblings('ul').hasClass('open-sub')) { 339 $(this).siblings('ul').removeClass('open-sub').hide('fadeIn'); 340 $(this).siblings('ul').hide('fadeIn'); 341 } 342 else { 343 $(this).siblings('ul').addClass('open-sub').hide('fadeIn'); 344 $(this).siblings('ul').slideToggle().show('fadeIn'); 345 } 346 }); 347 }; 348 349 if (settings.format === 'multitoggle') multiTg(); 350 else mobile_menu.addClass('dropdown'); 351 if (settings.sticky === true) mobile_menu.css('position', 'fixed'); 352 var resizeFix = function() { 353 if ($( window ).width() > 991) { 354 mobile_menu.find('ul').show('fadeIn'); 355 mobile_menu.find('ul.sub-menu').hide('fadeIn'); 356 } 357 }; 358 resizeFix(); 359 return $(window).on('resize', resizeFix); 360 }); 361 }; 362 363 $(document).ready(function(){ 364 $("#mobile_menu").menumaker({ 365 format: "multitoggle" 366 }); 367 368 // Odometer js 369 $(".odometer").html("0"); 370 $('.odometer').appear(function(e) { 371 var odo = $(".odometer"); 372 odo.each(function() { 373 var countNumber = $(this).attr("data-count"); 374 $(this).html(countNumber); 375 }); 376 }); 377 378 //Offcanvas js 379 function resizeNav() { 380 $(".menu-ofcn").css({"height": window.innerHeight}); 381 var radius = Math.sqrt(Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2)); 382 var diameter = radius * 2; 383 $(".off-nav-layer").width(diameter); 384 $(".off-nav-layer").height(diameter); 385 $(".off-nav-layer").css({"margin-top": -radius, "margin-left": -radius}); 386 } 387 $(".menu-button, .close-button, .offwrap").on('click', function() { 388 $(".nav-toggle, .menu-ofcn, .close-button, body").toggleClass("off-open"); 389 }); 390 $(window).resize(resizeNav); 391 resizeNav(); 392 }); 393 394 //woocommerce quantity style 395 if ( ! String.prototype.getDecimals ) { 396 String.prototype.getDecimals = function() { 397 var num = this, 398 match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); 399 if ( ! match ) { 400 return 0; 401 } 402 return Math.max( 0, ( match[1] ? match[1].length : 0 ) - ( match[2] ? +match[2] : 0 ) ); 403 } 404 } 405 406 // woocommerce Quantity "plus" and "minus" buttons 407 $(document.body ).on( 'click', '.plus, .minus', function() { 408 var $qty = $( this ).closest( '.quantity' ).find( '.qty'), 409 currentVal = parseFloat( $qty.val() ), 410 max = parseFloat( $qty.attr( 'max' ) ), 411 min = parseFloat( $qty.attr( 'min' ) ), 412 step = $qty.attr( 'step' ); 413 // Format values 414 if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; 415 if ( max === '' || max === 'NaN' ) max = ''; 416 if ( min === '' || min === 'NaN' ) min = 0; 417 if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1; 418 419 // Change the value 420 if ( $( this ).is( '.plus' ) ) { 421 if ( max && ( currentVal >= max ) ) { 422 $qty.val( max ); 423 } else { 424 $qty.val( ( currentVal + parseFloat( step )).toFixed( step.getDecimals() ) ); 425 } 426 } else { 427 if ( min && ( currentVal <= min ) ) { 428 $qty.val( min ); 429 } else if ( currentVal > 0 ) { 430 $qty.val( ( currentVal - parseFloat( step )).toFixed( step.getDecimals() ) ); 431 } 432 } 433 434 // Trigger change event 435 $qty.trigger( 'change' ); 436 }); 437 438 $('.cd-words-wrapper p').html(function(){ 439 var text = $(this).text().split(' '); 440 var last = text.pop(); 441 return text.join(" ") + (text.length > 0 ? ' <span class="last">'+last+'</span>' : last); 442 }); 443 444 //canvas menu 445 var navexpander = $('.nav-expander, .nav-expander2'); 446 if(navexpander.length){ 447 $('.nav-expander, .nav-expander2, .rsoffwrap, .rsoffwrap-close').on('click',function(e){ 448 e.preventDefault(); 449 $('body').toggleClass('nav-expanded'); 450 }); 451 $('ul.rs_onepage_mobile_menu li a, .right_menu_togle .widget_media_gallery .gallery-item div a').on('click',function(e){ 452 $('body').toggleClass('nav-expanded'); 453 }); 454 } 455 456 $('.accordion-menu-wrapper button').on('click',function(){ 457 $('.accordion-menu-wrapper button').removeClass('show'); 458 }); 459 460})(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.