1/* ===================================== 2All JavaScript fuctions Start 3======================================*/ 4 5/*-------------------------------------------------------------------------------------------- 6 document.ready ALL FUNCTION START 7---------------------------------------------------------------------------------------------*/ 8 /* 9 10 > Top Search bar Show Hide function by = custom.js 11 > On scroll content animated function by = Viewportchecker.js 12 > Video responsive function by = custom.js 13 > magnificPopup function by = magnific-popup.js 14 > magnificPopup for video function by = magnific-popup.js 15 > Vertically center Bootstrap modal popup function by = custom.js 16 > Main menu sticky on top when scroll down function by = custom.js 17 > page scroll top on button click function by = custom.js 18 > input type file function by = custom.js 19 > input Placeholder in IE9 function by = custom.js 20 > box height match window height according function by = custom.js 21 > footer fixed on bottom function by = custom.js 22 > accordion active calss function by = custom.js 23 > Top cart list Show Hide function by = custom.js 24 > Nav submenu show hide on mobile by = custom.js 25 > Home Carousel_1 Full Screen with no margin function by = owl.carousel.js 26 > related with content function by = owl.carousel.js 27 > Fade slider for home function by = owl.carousel.js 28 > Blog post Carousel function by = owl.carousel.js 29 > blog Carousel_1 Full Screen with no margin function by = owl.carousel.js // 30 > Home4 services Carousel_1 Full Screen with no margin function by = owl.carousel.js // 31 > home4_logo_carousel() function by = owl.carousel.js // 32 */ 33 34/*-------------------------------------------------------------------------------------------- 35 window on load ALL FUNCTION START 36---------------------------------------------------------------------------------------------*/ 37 /* 38 > equal each box 39 > skills bar function function by = custom.js 40 2.1 skills bar tooltips 41 2.2 skills bar widths 42 > Bootstrap Select box function by = bootstrap-select.min.js 43 > TouchSpin box function by = jquery.bootstrap-touchspin.js 44 > TouchSpin box function by = jquery.bootstrap-touchspin.js 45 > masonry function function by = isotope.pkgd.min.js 46 > page loader function by = custom.js 47 */ 48/*-------------------------------------------------------------------------------------------- 49 Window Scroll ALL FUNCTION START 50---------------------------------------------------------------------------------------------*/ 51 /* 52 > Window on scroll header color fill 53 */ 54 55/*-------------------------------------------------------------------------------------------- 56 Window Resize ALL FUNCTION START 57---------------------------------------------------------------------------------------------*/ 58 59(function ($) { 60 61 'use strict'; 62/*-------------------------------------------------------------------------------------------- 63 document.ready ALL FUNCTION START 64---------------------------------------------------------------------------------------------*/ 65 66// > Top Search bar Show Hide function by = custom.js =================== // 67 function site_search(){ 68 jQuery('a[href="#search"]').on('click', function(event) { 69 jQuery('#search').addClass('open'); 70 jQuery('#search > form > input[type="search"]').focus(); 71 }); 72 73 jQuery('#search, #search button.close').on('click keyup', function(event) { 74 if (event.target === this || event.target.className === 'close') { 75 jQuery(this).removeClass('open'); 76 } 77 }); 78 } 79// > Video responsive function by = custom.js ========================= // 80 81 function video_responsive(){ 82 jQuery('iframe[src*="youtube.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>'); 83 jQuery('iframe[src*="vimeo.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>'); 84 } 85 86 87 88// > magnificPopup function by = magnific-popup.js =========================== // 89 90 function magnific_popup(){ 91 jQuery('.mfp-gallery').magnificPopup({ 92 delegate: '.mfp-link', 93 type: 'image', 94 tLoading: 'Loading image #%curr%...', 95 mainClass: 'mfp-img-mobile', 96 gallery: { 97 enabled: true, 98 navigateByImgClick: true, 99 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 100 }, 101 image: { 102 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 103 } 104 }); 105 } 106 107// > magnificPopup for video function by = magnific-popup.js ===================== // 108 109 function magnific_video(){ 110 jQuery('.mfp-video').magnificPopup({ 111 type: 'iframe', 112 }); 113 } 114 115// Vertically center Bootstrap modal popup function by = custom.js ==============// 116 117 function popup_vertical_center(){ 118 jQuery(function() { 119 function reposition() { 120 var modal = jQuery(this),
121 dialog = modal.find('.modal-dialog'); 122 modal.css('display', 'block'); 123 // Dividing by two centers the modal exactly, but dividing by three 124 // or four works better for larger screens. 125 dialog.css("margin-top", Math.max(0, (jQuery(window).height() - dialog.height()) / 2)); 126 } 127 // Reposition when a modal is shown 128 jQuery('.modal').on('show.bs.modal', reposition); 129 // Reposition when the window is resized 130 jQuery(window).on('resize', function() { 131 jQuery('.modal:visible').each(reposition); 132 }); 133 }); 134 } 135 136// > Main menu sticky on top when scroll down function by = custom.js ========== // 137 138 function sticky_header(){ 139 if(jQuery('.sticky-header').length){ 140 var sticky = new Waypoint.Sticky({ 141 element: jQuery('.sticky-header') 142 }) 143 } 144 } 145 146// > page scroll top on button click function by = custom.js ===================== // 147 148 function scroll_top(){ 149 jQuery("button.scroltop").on('click', function() { 150 jQuery("html, body").animate({ 151 scrollTop: 0 152 }, 1000); 153 return false; 154 }); 155 156 jQuery(window).on("scroll", function() { 157 var scroll = jQuery(window).scrollTop(); 158 if (scroll > 900) { 159 jQuery("button.scroltop").fadeIn(1000); 160 } else { 161 jQuery("button.scroltop").fadeOut(1000); 162 } 163 }); 164 } 165 166// > input type file function by = custom.js ========================== // 167 168 function input_type_file_form(){ 169 jQuery(document).on('change', '.btn-file :file', function() { 170 var input = jQuery(this), 171 numFiles = input.get(0).files ? input.get(0).files.length : 1, 172 label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); 173 input.trigger('fileselect', [numFiles, label]); 174 }); 175 176 jQuery('.btn-file :file').on('fileselect', function(event, numFiles, label) { 177 var input = jQuery(this).parents('.input-group').find(':text'), 178 log = numFiles > 10 ? numFiles + ' files selected' : label; 179 if (input.length) { 180 input.val(log); 181 } else { 182 if (log) alert(log); 183 } 184 }); 185 } 186 187// > input Placeholder in IE9 function by = custom.js ======================== // 188 189 function placeholderSupport(){ 190 /* input placeholder for ie9 & ie8 & ie7 */ 191 jQuery.support.placeholder = ('placeholder' in document.createElement('input')); 192 /* input placeholder for ie9 & ie8 & ie7 end*/ 193 /*fix for IE7 and IE8 */ 194 if (!jQuery.support.placeholder) { 195 jQuery("[placeholder]").on('focus', function () { 196 if (jQuery(this).val() === jQuery(this).attr("placeholder")) jQuery(this).val(""); 197 }).blur(function () { 198 if (jQuery(this).val() === "") jQuery(this).val(jQuery(this).attr("placeholder")); 199 }).blur(); 200 201 jQuery("[placeholder]").parents("form").on('submit', function () { 202 jQuery(this).find('[placeholder]').each(function() { 203 if (jQuery(this).val() === jQuery(this).attr("placeholder")) { 204 jQuery(this).val(""); 205 } 206 }); 207 }); 208 } 209 /*fix for IE7 and IE8 end */ 210 } 211 212// > box height match window height according function by = custom.js ========= // 213 214 function set_height() { 215 if(jQuery('.demo-wraper').length){ 216 windowHeight = jQuery(window).innerHeight(); 217 jQuery('.demo-wraper').css('min-height', windowHeight); 218 } 219 } 220 221// > footer fixed on bottom function by = custom.js ======================== // 222 223 function footer_fixed() { 224 jQuery('.site-footer').css('display', 'block'); 225 jQuery('.site-footer').css('height', 'auto'); 226 var footerHeight = jQuery('.site-footer').outerHeight(); 227 jQuery('.footer-fixed > .page-wraper').css('padding-bottom', footerHeight); 228 jQuery('.site-footer').css('height', footerHeight); 229 } 230 231// > accordion active calss function by = custom.js ========================= // 232 233 function accordion_active() { 234 $('.acod-head a').on('click', function() { 235 $('.acod-head').removeClass('acc-actives'); 236 $(this).parents('.acod-head').addClass('acc-actives'); 237 $('.acod-title').removeClass('acc-actives'); //just to make a visual sense 238 $(this).parent().addClass('acc-actives'); //just to make a visual sense 239 ($(this).parents('.acod-head').attr('class')); 240 }); 241 } 242 243// > Top cart list Show Hide function by = custom.js =================== // 244 245 //________Nav submenu show hide on mobile by = custom.js________// 246 function mobile_nav(){ 247 jQuery(".sub-menu, .mega-menu").parent('li').addClass('has-child'); 248 jQuery("<div class='fa fa-angle-right submenu-toogle'></div>").insertAfter(".has-child > a"); 249 250 jQuery('.has-child a+.submenu-toogle').on('click',function(ev) { 251 252 jQuery(this).parent().siblings(".has-child ").children(".sub-menu, .mega-menu").slideUp(500, function(){ 253 jQuery(this).parent().removeClass('nav-active'); 254 }); 255
256 jQuery(this).next(jQuery('.sub-menu, .mega-menu ')).slideToggle(500, function(){ 257 jQuery(this).parent().toggleClass('nav-active'); 258 }); 259 260 ev.stopPropagation(); 261 }); 262 263 } 264 //________Mobile side drawer function by = custom.js________// 265 function mobile_side_drawer(){ 266 jQuery('#mobile-side-drawer').on('click', function () { 267 jQuery('.mobile-sider-drawer-menu').toggleClass('active'); 268 }); 269 270 } 271 272 273// > Home Carousel_1 Full Screen with no margin function by = owl.carousel.js ========================== // 274 275 function home_carousel_1(){ 276 jQuery('.home-carousel-1').owlCarousel({ 277 loop:true, 278 margin:0, 279 nav:true, 280 dots: false, 281 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 282 responsive:{ 283 0:{ 284 items:1 285 }, 286 480:{ 287 items:2 288 }, 289 767:{ 290 items:3 291 }, 292 1000:{ 293 items:4 294 }, 295 1200:{ 296 items:5 297 } 298 } 299 }); 300 } 301 302 303// related with content function by = owl.carousel.js ========================== // 304 function blog_related_slider(){ 305 jQuery('.blog-related-slider').owlCarousel({ 306 loop:true, 307 margin:30, 308 nav:true, 309 dots: false, 310 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 311 responsive:{ 312 0:{ 313 items:1 314 }, 315 480:{ 316 items:2 317 }, 318 767:{ 319 items:2 320 }, 321 1200:{ 322 items:3 323 } 324 } 325 }); 326 } 327 328 329 330// Fade slider for home function by = owl.carousel.js ========================== // 331 function aboutus_carousel(){ 332 jQuery('.about-us-carousel').owlCarousel({ 333 loop:true, 334 autoplay:true, 335 autoplayTimeout:2000, 336 margin:30, 337 nav:true, 338 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 339 items:1, 340 dots: true, 341 animateOut:'fadeOut', 342 343 }); 344 } 345 346 347// Blog post Carousel function by = owl.carousel.js ========================== // 348 function service_detail_carousel(){ 349 jQuery('.service-detail-carousel').owlCarousel({ 350 loop:true, 351 autoplay:true, 352 autoplayTimeout:2000, 353 margin:30, 354 nav:true, 355 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 356 items:1, 357 dots: true, 358 animateOut:'fadeOut', 359 }) ; 360 } 361 362// > blog Carousel_1 Full Screen with no margin function by = owl.carousel.js ========================== // 363 364 function blog_carousel_1(){ 365 jQuery('.blog-carousel').owlCarousel({ 366 loop:true, 367 margin:10, 368 nav:true, 369 dots: false, 370 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 371 responsive:{ 372 0:{ 373 items:1 374 }, 375 480:{ 376 items:2 377 }, 378 767:{ 379 items:3 380 }, 381 1000:{ 382 items:4 383 }, 384 1200:{ 385 items:3 386 } 387 } 388 }); 389 } 390 391 392// > Home4 services Carousel_1 Full Screen with no margin function by = owl.carousel.js ========================== // 393 394 function Home_services_carousel(){ 395 jQuery('.Home-services-carousel').owlCarousel({ 396 loop:true, 397 margin:30, 398 nav:true, 399 dots: false, 400 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 401 responsive:{ 402 0:{ 403 items:1, 404 }, 405 480:{ 406 items:2, 407 }, 408 767:{ 409 items:3, 410 }, 411 1200:{ 412 items:3, 413 mouseDrag:false, 414 touchDrag:false, 415 pullDrag:false, 416 freeDrag:false, 417 } 418 } 419 }); 420 } 421 422 423// > home_logo_carousel() function by = owl.carousel.js ========================== // 424 function home4_logo_carousel(){ 425 jQuery('.home4-logo-carousel').owlCarousel({ 426 loop:true, 427 autoplay:true, 428 margin:0, 429 nav:false, 430 dots: false, 431 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 432 responsive:{ 433 0:{ 434 items:2 435 }, 436 480:{ 437 items:3 438 }, 439 440 767:{ 441 items:4 442 }, 443 1000:{ 444 items:5 445 } 446 } 447 448 }); 449 } 450/*-------------------------------------------------------------------------------------------- 451 Window on load ALL FUNCTION START 452---------------------------------------------------------------------------------------------*/ 453 454// > equal each box function by = custom.js =========================== // 455 456 function equalheight(container) { 457 var currentTallest = 0, 458 currentRowStart = 0, 459 rowDivs = new Array(), 460 $el, topPosition = 0, 461 currentDiv = 0; 462 463 jQuery(container).each(function() { 464 $el = jQuery(this); 465 jQuery($el).height('auto'); 466 var topPostion = $el.position().top; 467 if (currentRowStart != topPostion) { 468 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 469 rowDivs[currentDiv].height(currentTallest); 470 } 471 rowDivs.length = 0; // empty the array 472 currentRowStart = topPostion; 473 currentTallest = $el.height(); 474 rowDivs.push($el); 475 } else { 476 477 rowDivs.push($el); 478 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 479 } 480 481 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 482 rowDivs[currentDiv].height(currentTallest); 483 } 484 }); 485 } 486 487// > On scroll content animated function by = Viewportchecker.js ============= // 488 489/* 490 function animate_content(){ 491 jQuery('.animate').scrolla({ 492 mobile: false, 493 once: true 494 }); 495 } 496*/ 497// > skills bar function function by = custom.js ========================= // 498 499 /* 2.1 skills bar tooltips*/ 500 function progress_bar_tooltips() { 501 jQuery(function () { 502 jQuery('[data-toggle="tooltips"]').tooltip({trigger: 'manual'}).tooltip('show'); 503 }); 504 505 } 506 507 /* 2.2 skills bar widths*/ 508 509 function progress_bar_width() { 510 jQuery( window ).on('scroll', function() { 511 jQuery(".progress-bar").each(function(){ 512 progress_bar_width = jQuery(this).attr('aria-valuenow'); 513 jQuery(this).width(progress_bar_width + '%'); 514 }); 515 }); 516 } 517 518// > Bootstrap Select box function by = bootstrap-select.min.js =============== // 519 520 function select_box_form() { 521 jQuery('.selectpicker').selectpicker() 522 } 523 524// > TouchSpin box function by = jquery.bootstrap-touchspin.js =============== // 525 526 function input_number_form() { 527 jQuery("input[name='demo3']").TouchSpin() 528 } 529 530// > TouchSpin box function by = jquery.bootstrap-touchspin.js =============== // 531 532 function input_number_vertical_form() { 533 jQuery("input[name='demo_vertical2']").TouchSpin({ 534 verticalbuttons: true, 535 verticalupclass: 'glyphicon glyphicon-plus', 536 verticaldownclass: 'glyphicon glyphicon-minus' 537 }) 538 } 539 540// > masonry function function by = isotope.pkgd.min.js ========================= // 541 542 function masonryBox() { 543 if ( jQuery().isotope ) { 544 var $container = jQuery('.portfolio-wrap'); 545 $container.isotope({ 546 itemSelector: '.masonry-item', 547 transitionDuration: '1s', 548 originLeft: true, 549 filter: '.pic-up' 550 }); 551 552 $container.imagesLoaded().progress( function() { 553 $container.isotope('layout'); 554 }); 555 556 jQuery('.masonry-filter li').on('click',function() { 557 var selector = jQuery(this).find("a").attr('data-filter'); 558 jQuery('.masonry-filter li').removeClass('active'); 559 jQuery(this).addClass('active'); 560 $container.isotope({ filter: selector }); 561 return false;
562 }); 563 }; 564 } 565 566// > page loader function by = custom.js ========================= // 567 568 function page_loader() { 569 $('.loading-area').fadeOut(1000) 570 }; 571 572/*-------------------------------------------------------------------------------------------- 573 Window on scroll ALL FUNCTION START 574---------------------------------------------------------------------------------------------*/ 575 576 function color_fill_header() { 577 var scroll = $(window).scrollTop(); 578 if(scroll >= 100) { 579 $(".is-fixed").addClass("color-fill"); 580 } else { 581 $(".is-fixed").removeClass("color-fill"); 582 } 583 }; 584 585 /*Tooltip*/ 586 var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) 587 var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { 588 return new bootstrap.Tooltip(tooltipTriggerEl) 589 }) 590 /*Popover*/ 591 var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) 592 var popoverList = popoverTriggerList.map(function (popoverTriggerEl) { 593 return new bootstrap.Popover(popoverTriggerEl) 594 }) 595 596/*-------------------------------------------------------------------------------------------- 597 document.ready ALL FUNCTION START 598---------------------------------------------------------------------------------------------*/ 599 jQuery(document).ready(function() { 600 // > Top Search bar Show Hide function by = custom.js 601 site_search(), 602 // > Video responsive function by = custom.js 603 video_responsive(), 604 // > magnificPopup function by = magnific-popup.js 605 magnific_popup(), 606 // > magnificPopup for video function by = magnific-popup.js 607 magnific_video(), 608 // > Vertically center Bootstrap modal popup function by = custom.js 609 popup_vertical_center(); 610 // > Main menu sticky on top when scroll down function by = custom.js 611 sticky_header(), 612 // > page scroll top on button click function by = custom.js 613 scroll_top(), 614 // > input type file function by = custom.js 615 input_type_file_form(), 616 // > input Placeholder in IE9 function by = custom.js 617 placeholderSupport(), 618 // > box height match window height according function by = custom.js 619 set_height(), 620 // > footer fixed on bottom function by = custom.js 621 footer_fixed(), 622 // > accordion active calss function by = custom.js ========================= // 623 accordion_active(), 624 // > Top cart list Show Hide function by = custom.js =================== // 625 // cart_block(), 626 // > Nav submenu on off function by = custome.js ===================// 627 mobile_nav(), 628 //________Mobile side drawer function by = custom.js________// 629 mobile_side_drawer(), 630 // > Home Carousel_1 Full Screen with no margin function by = owl.carousel.js 631 home_carousel_1(), 632 // related with content function by = owl.carousel.js ========================== // 633 blog_related_slider(), 634 // Fade slider for home function by = owl.carousel.js ========================== // 635 aboutus_carousel(), 636 // Blog post Carousel function by = owl.carousel.js ========================== // 637 service_detail_carousel(), 638 // blog Carousel_1 Full Screen with no margin function by = owl.carousel.js ========================== // 639 blog_carousel_1(), 640 // Home4 services Carousel_1 Full Screen with no margin function by = owl.carousel.js ========================== // 641 Home_services_carousel() , 642 // home4_logo_carousel() function by = owl.carousel.js ========================== // 643 home4_logo_carousel() 644 }); 645 646/*-------------------------------------------------------------------------------------------- 647 Window Load START 648---------------------------------------------------------------------------------------------*/ 649 jQuery(window).on('load', function () { 650 // > equal each box function by = custom.js 651 equalheight(".equal-wraper .equal-col"), 652 // > On scroll content animated function by = Viewportchecker.js 653 //animate_content(), 654 // > skills bar function function by = custom.js 655 progress_bar_tooltips(), 656 // > skills bar function function by = custom.js 657 progress_bar_width(), 658 // > On scroll content animated function by = Viewportchecker.js 659 select_box_form(), 660 // > TouchSpin box function by = jquery.bootstrap-touchspin.js 661 input_number_form(), 662 // > TouchSpin box function by = jquery.bootstrap-touchspin.js 663 input_number_vertical_form(), 664 // > box height match window height according function by = custom.js 665 set_height(), 666 // > masonry function function by = isotope.pkgd.min.js 667 masonryBox(), 668 // > page loader function by = custom.js 669 page_loader() 670}); 671 672 /*=========================== 673 Window Scroll ALL FUNCTION START 674===========================*/ 675 676 jQuery(window).on('scroll', function () { 677 // > Window on scroll header color fill 678 color_fill_header() 679 }); 680 681/*=========================== 682 Window Resize ALL FUNCTION START 683===========================*/ 684 685 jQuery(window).on('resize', function () { 686 // > footer fixed on bottom function by = custom.js 687 footer_fixed(), 688 // > masonry function function by = isotope.pkgd.min.js 689 masonryBox(), 690 // > box height match window height according function by = custom.js 691 set_height() 692 }); 693 694/*=========================== 695 Document on Submit FUNCTION START 696===========================*/ 697 698 // > Contact form function by = custom.js 699 jQuery(document).on('submit', 'form.cons-contact-form', function(e){ 700 e.preventDefault(); 701 var form = jQuery(this); 702 /* sending message */ 703 jQuery.ajax({ 704 url: 'http://thewebmax.com/build/form-handler.php', 705 data: form.serialize() + "&action=contactform", 706 type: 'POST', 707 dataType: 'JSON', 708 beforeSend: function() { 709 jQuery('.loading-area').show(); 710 }, 711 712 success:function(data){ 713 jQuery('.loading-area').hide(); 714 if(data['success']){ 715 jQuery("<div class='alert alert-success'>"+data['message']+"</div>").insertBefore('form.cons-contact-form'); 716 }else{ 717 jQuery("<div class='alert alert-danger'>"+data['message']+"</div>").insertBefore('form.cons-contact-form'); 718 } 719 } 720 }); 721 return false;
722 }); 723 724/*=========================== 725 Document on Submit FUNCTION END 726===========================*/ 727 728 729})(window.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.