1"use strict"; 2var lastScroll = 0; 3 4 5 6 7 8//check for browser os 9var isMobile = false; 10var isiPhoneiPad = false; 11if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 12 isMobile = true; 13} 14 15if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 16 isiPhoneiPad = true; 17} 18 19function SetMegamenuPosition() { 20 if ($(window).width() > 991) { 21 setTimeout(function () { 22 var totalHeight = $('nav.navbar').outerHeight(); 23 $('.mega-menu').css({ top: totalHeight }); 24 if ($('.navbar-brand-top').length === 0) 25 $('.dropdown.simple-dropdown > .dropdown-menu').css({ top: totalHeight }); 26 }, 200); 27 } else { 28 $('.mega-menu').css('top', ''); 29 $('.dropdown.simple-dropdown > .dropdown-menu').css('top', ''); 30 } 31} 32 33function pad(d) { 34 return (d < 10) ? '0' + d.toString() : d.toString(); 35} 36 37function isIE() { 38 var ua = window.navigator.userAgent; 39 var msie = ua.indexOf("MSIE "); 40 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number 41 { 42 return true; 43 } else // If another browser, return 0 44 { 45 return false; 46 } 47} 48 49//page title space 50function setPageTitleSpace() { 51 if ($('.navbar').hasClass('navbar-top') || $('nav').hasClass('navbar-fixed-top')) { 52 if ($('.top-space').length > 0) { 53 var top_space_height = $('.navbar').outerHeight(); 54 if ($('.top-header-area').length > 0) { 55 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 56 } 57 $('.top-space').css('margin-top', top_space_height + "px"); 58 } 59 } 60} 61 62//swiper button position in auto height slider 63function setButtonPosition() { 64 if ($(window).width() > 767 && $(".swiper-auto-height-container").length > 0) { 65 var leftPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-left')); 66 var bottomPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-bottom')); 67 var bannerWidth = parseInt($('.swiper-auto-height-container .slide-banner').outerWidth()); 68 $('.navigation-area').css({ 'left': bannerWidth + leftPosition + 'px', 'bottom': bottomPosition + 'px' }); 69 } else if ($(".swiper-auto-height-container").length > 0) { 70 $('.navigation-area').css({ 'left': '', 'bottom': '' }); 71 } 72} 73 74$(window).on("scroll", init_scroll_navigate); 75function init_scroll_navigate() { 76 /*============================================================== 77 One Page Main JS - START CODE 78 =============================================================*/ 79 var menu_links = $(".navbar-nav li a"); 80 var scrollPos = $(document).scrollTop(); 81 menu_links.each(function () { 82 var currLink = $(this); 83 if (currLink.attr("href").indexOf("#") > -1 && $(currLink.attr("href")).length > 0) { 84 var refElement = $(currLink.attr("href")); 85 if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) { 86 menu_links.removeClass("active"); 87 currLink.addClass("active"); 88 } else { 89 currLink.removeClass("active"); 90 } 91 } 92 }); 93 /*============================================================== 94 One Page Main JS - END CODE 95 =============================================================*/ 96 97 /*==============================================================*/ 98 //background color slider Start 99 /*==============================================================*/ 100 var $window = $(window), 101 $body = $('.bg-background-fade'), 102 $panel = $('.color-code'); 103 var scroll = $window.scrollTop() + ($window.height() / 2); 104 $panel.each(function () { 105 var $this = $(this); 106 if ($this.position().top <= scroll && $this.position().top + $this.height() > scroll) { 107 $body.removeClass(function (index, css) { 108 return (css.match(/(^|\s)color-\S+/g) || []).join(' '); 109 }); 110 $body.addClass('color-' + $(this).data('color')); 111 } 112 }); 113 /*==============================================================*/ 114 //background color slider End 115 /*==============================================================*/ 116 117 /* =================================== 118 sticky nav Start 119 ====================================== */ 120 var headerHeight = $('nav').outerHeight(); 121 if (!$('header').hasClass('no-sticky')) { 122 if ($(document).scrollTop() >= headerHeight) { 123 $('header').addClass('sticky'); 124 125 } else if ($(document).scrollTop() <= headerHeight) { 126 $('header').removeClass('sticky'); 127 setTimeout(function () { 128 setPageTitleSpace(); 129 }, 500); 130 } 131 SetMegamenuPosition(); 132 } 133 134 /* =================================== 135 header appear on scroll up 136 ====================================== */ 137 var st = $(this).scrollTop(); 138 if (st > lastScroll) { 139 $('.sticky').removeClass('header-appear'); 140 $('.dropdown.on').removeClass('on').removeClass('open').find('.dropdown-menu').fadeOut(100); 141 } else 142 $('.sticky').addClass('header-appear'); 143 lastScroll = st; 144 if (lastScroll <= headerHeight) 145 $('header').removeClass('header-appear'); 146 /* =================================== 147 sticky nav End 148 ====================================== */ 149} 150 151/*============================================================== 152parallax text - START CODE 153==============================================================*/ 154function parallax_text() { 155 var window_width = $(window).width(); 156 if (window_width > 1024) { 157 if ($('.swiper-auto-width .swiper-slide').length !== 0) { 158 $(document).on("mousemove", ".swiper-auto-width .swiper-slide", function (e) { 159 var positionX = e.clientX; 160 var positionY = e.clientY; 161 positionX = Math.round(positionX / 10) - 80; 162 positionY = Math.round(positionY / 10) - 40; 163 $(this).find('.parallax-text').css({ 'transform': 'translate(' + positionX + 'px,' + positionY + 'px)', 'transition-duration': '0s' }); 164 }); 165 166 $(document).on("mouseout", ".swiper-auto-width .swiper-slide", function (e) { 167 $('.parallax-text').css({ 'transform': 'translate(0,0)', 'transition-duration': '0.5s' }); 168 }); 169 } 170 } 171} 172/*==============================================================*/ 173//parallax text - END CODE 174/*==============================================================*/ 175 176/*==============================================================*/ 177//Search - START CODE 178/*==============================================================*/ 179function ScrollStop() { 180 return false;
181} 182function ScrollStart() { 183 return true; 184} 185function validationSearchForm() { 186 var error = true; 187 $('#search-header input[type=text]').each(function (index) { 188 if (index === 0) { 189 if ($(this).val() === null || $(this).val() === "") { 190 $("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid red" }); 191 error = false; 192 } else { 193 $("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid #000" }); 194 } 195 } 196 }); 197 return error; 198} 199/*============================================================== 200Search - END CODE 201==============================================================*/ 202 203/*============================================================== 204equalize - START CODE 205==============================================================*/ 206function equalizeHeight() { 207 $(document).imagesLoaded(function () { 208 if ($(window).width() < 768) { 209 $('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 210 $('.equalize.md-equalize-auto').children().css("height", ""); 211 $('.equalize.sm-equalize-auto').children().css("height", ""); 212 $('.equalize.xs-equalize-auto').children().css("height", ""); 213 return false; 214 } else if ($(window).width() < 992) { 215 $('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 216 $('.equalize.md-equalize-auto').children().css("height", ""); 217 $('.equalize.sm-equalize-auto').children().css("height", ""); 218 return false; 219 } else if ($(window).width() < 1199) { 220 $('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 221 $('.equalize.md-equalize-auto').children().css("height", ""); 222 return false; 223 } else { 224 $('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 225 } 226 }); 227} 228/*============================================================== 229equalize - END CODE 230==============================================================*/ 231 232/*============================================================== 233dynamic font size START CODE 234==============================================================*/ 235function feature_dynamic_font_line_height() { 236 if ($('.dynamic-font-size').length > 0) { 237 var site_width = 1100; 238 var window_width = $(window).width(); 239 if (window_width < site_width) { 240 var window_site_width_ratio = window_width / site_width; 241 $('.dynamic-font-size').each(function () { 242 var font_size = $(this).attr('data-fontsize'); 243 var line_height = $(this).attr('data-lineheight'); 244 if (font_size != '' && font_size != undefined) { 245 var new_font_size = Math.round(font_size * window_site_width_ratio * 1000) / 1000; 246 $(this).css('font-size', new_font_size + 'px'); 247 } 248 if (line_height !== '' && line_height !== undefined) { 249 var new_line_height = Math.round(line_height * window_site_width_ratio * 1000) / 1000; 250 $(this).css('line-height', new_line_height + 'px'); 251 } 252 }); 253 } else { 254 $('.dynamic-font-size').each(function () { 255 var font_size = $(this).attr('data-fontsize'); 256 var line_height = $(this).attr('data-lineheight'); 257 if (font_size !== '' && font_size !== undefined) { 258 $(this).css('font-size', font_size + 'px'); 259 } 260 if (line_height !== '' && line_height !== undefined) { 261 $(this).css('line-height', line_height + 'px'); 262 } 263 }); 264 } 265 } 266} 267/*============================================================== 268dynamic font size END CODE 269==============================================================*/ 270 271/*============================================================== 272set parallax 273==============================================================*/ 274function stellarParallax() { 275 if ($(window).width() > 1024) { 276 $.stellar(); 277 } else { 278 $.stellar('destroy'); 279 $('.parallax').css('background-position', ''); 280 } 281} 282 283/*============================================================== 284full screen START CODE 285==============================================================*/ 286function fullScreenHeight() { 287 var element = $(".full-screen"); 288 var $minheight = $(window).height(); 289 element.parents('section').imagesLoaded(function () { 290 if ($(".top-space .full-screen").length > 0) { 291 var $headerheight = $("header nav.navbar").outerHeight(); 292 $(".top-space .full-screen").css('min-height', $minheight - $headerheight); 293 } else { 294 element.css('min-height', $minheight); 295 } 296 }); 297 298 var minwidth = $(window).width(); 299 $(".full-screen-width").css('min-width', minwidth); 300 var sidebarNavHeight = $('.sidebar-nav-style-1').height() - $('.logo-holder').parent().height() - $('.footer-holder').parent().height() - 10; 301 $(".sidebar-nav-style-1 .nav").css('height', (sidebarNavHeight)); 302 var style2NavHeight = parseInt($('.sidebar-part2').height() - parseInt($('.sidebar-part2 .sidebar-middle').
302css('padding-top')) - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-bottom')) - parseInt($(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('margin-bottom'))); 303 $(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('height', (style2NavHeight)); 304 305 306} 307/*============================================================== 308full screen END CODE 309==============================================================*/ 310function SetResizeContent() { 311 // all function call 312 feature_dynamic_font_line_height(); 313 SetMegamenuPosition(); 314 setPageTitleSpace(); 315 setButtonPosition(); 316 parallax_text(); 317 stellarParallax(); 318 fullScreenHeight(); 319 equalizeHeight(); 320} 321 322/* =================================== 323START RESIZE 324====================================== */ 325$(window).resize(function (event) { 326 // Bootsnav menu work with eualize height 327 $("nav.navbar.bootsnav ul.nav").each(function () { 328 $("li.dropdown", this).on("mouseenter", function (e) { 329 if ($(window).width() > 991) { 330 $(this).find('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 331 return false; 332 } 333 }); 334 }); 335 336 setTimeout(function () { 337 SetResizeContent(); 338 }, 500); 339 340 event.preventDefault(); 341}); 342/* =================================== 343END RESIZE 344====================================== */ 345 346/* =================================== 347START READY 348====================================== */ 349$(document).ready(function () { 350 "use strict"; 351 // Bootsnav menu work with eualize height 352 $("nav.navbar.bootsnav ul.nav").each(function () { 353 $("li.dropdown", this).on("mouseenter", function () { 354 if ($(window).width() > 991) { 355 $(this).find('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 356 return false; 357 } 358 }); 359 }); 360 // Bootsnav tab work with eualize height 361 $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { 362 var target = $(e.target).attr("href"); 363 if ($(window).width() > 991) { 364 $(target).find('.equalize').equalize({ equalize: 'outerHeight', reset: true }); 365 return false; 366 } 367 }); 368 369 // Active class to current menu for only html 370 var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1); 371 var $hash = window.location.hash.substring(1); 372 373 if ($hash) { 374 $hash = "#" + $hash; 375 pgurl = pgurl.replace($hash, ""); 376 } else { 377 pgurl = pgurl.replace("#", ""); 378 } 379 380 $(".nav li a").each(function () { 381 if ($(this).attr("href") == pgurl || $(this).attr("href") == pgurl + '.html') { 382 $(this).parent().addClass("active"); 383 $(this).parents('li.dropdown').addClass("active"); 384 } 385 }); 386 $(window).scroll(function () { 387 if ($(this).scrollTop() > 150) 388 $('.scroll-top-arrow').fadeIn('slow'); 389 else 390 $('.scroll-top-arrow').fadeOut('slow'); 391 }); 392 //Click event to scroll to top 393 $(document).on('click', '.scroll-top-arrow', function () { 394 $('html, body').animate({ scrollTop: 0 }, 800); 395 return false; 396 }); 397 398 /* =================================== 399 swiper slider 400 ====================================== */ 401 var swiperFull = new Swiper('.swiper-full-screen', { 402 pagination: '.swiper-pagination', 403 paginationClickable: true, 404 loop: true, 405 autoplay: 5000, 406 slidesPerView: 1, 407 keyboardControl: true, 408 preventClicks: false, 409 nextButton: '.swiper-button-next', 410 prevButton: '.swiper-button-prev' 411 }); 412 413 var swiperAutoFade = new Swiper('.swiper-auto-fade', { 414 pagination: '.swiper-pagination', 415 loop: true, 416 autoplay: 5000, 417 slidesPerView: 1, 418 paginationClickable: true, 419 keyboardControl: true, 420 preventClicks: false, 421 effect: 'fade', 422 nextButton: '.swiper-button-next', 423 prevButton: '.swiper-button-prev' 424 }); 425 426 var swiperSecond = new Swiper('.swiper-slider-second', { 427 pagination: '.swiper-pagination-second', 428 slidesPerView: 1, 429 paginationClickable: true, 430 keyboardControl: true, 431 preventClicks: false, 432 nextButton: '.swiper-button-next', 433 prevButton: '.swiper-button-prev' 434 }); 435 436 var swiperThird = new Swiper('.swiper-slider-third', { 437 pagination: '.swiper-pagination-third', 438 slidesPerView: 1, 439 paginationClickable: true, 440 keyboardControl: true, 441 preventClicks: false, 442 nextButton: '.swiper-button-next', 443 prevButton: '.swiper-button-prev' 444 }); 445 446 var swiperNumber = new Swiper('.swiper-number-pagination', { 447 pagination: '.swiper-number', 448 paginationClickable: true, 449 autoplay: 4000, 450 preventClicks: false, 451 autoplayDisableOnInteraction: false, 452 paginationBulletRender: function (swiper, index, className) { 453 return '<span class="' + className + '">' + pad((index + 1)) + '</span>'; 454 } 455 }); 456 457 var swiperVerticalPagination = new Swiper('.swiper-vertical-pagination', { 458 pagination: '.swiper-pagination-white', 459 direction: 'vertical', 460 slidesPerView: 1, 461 paginationClickable: true, 462 spaceBetween: 0, 463 preventClicks: false, 464 mousewheelControl: true 465 }); 466 467 var swiperClients = new Swiper('.swiper-slider-clients', { 468 pagination: null, 469 slidesPerView: 4, 470 paginationClickable: true, 471 autoplay: 3000, 472 preventClicks: false, 473 autoplayDisableOnInteraction: false, 474 breakpoints: { 475 480: { 476 slidesPerView: 1 477 }, 478 650: { 479 slidesPerView: 2 480 }, 481 850: { 482 slidesPerView: 3 483 } 484 } 485 }); 486 487 var swiperThreeSlides = new Swiper('.swiper-three-slides', { 488 pagination: '.swiper-pagination-three-slides', 489 paginationClickable: true, 490 slidesPerView: 3, 491 keyboardControl: true, 492 mousewheelControl: false, 493 preventClicks: false, 494 nextButton: '.second-swiper-button-next', 495 prevButton: '.second-swiper-button-prev', 496 breakpoints: { 497 480: { 498 slidesPerView: 1 499 }, 500 767: { 501 slidesPerView: 2 502 }, 503 850: { 504 slidesPerView: 2 505 } 506 } 507 }); 508
509 var swiperFourSlides = new Swiper('.swiper-four-slides', { 510 pagination: '.swiper-pagination-four-slides', 511 autoplay: 3000, 512 slidesPerView: 4, 513 paginationClickable: true, 514 keyboardControl: true, 515 mousewheelControl: false, 516 preventClicks: false, 517 nextButton: '.swiper-button-next', 518 prevButton: '.swiper-button-prev', 519 breakpoints: { 520 850: { 521 slidesPerView: 2 522 }, 523 650: { 524 slidesPerView: 2 525 }, 526 480: { 527 slidesPerView: 1 528 } 529 } 530 }); 531 532 var swiperDemoHeaderStyle = new Swiper('.swiper-demo-header-style', { 533 pagination: '.swiper-pagination-demo-header-style', 534 loop: true, 535 autoplay: 3000, 536 slidesPerView: 4, 537 paginationClickable: true, 538 keyboardControl: true, 539 mousewheelControl: false, 540 preventClicks: true, 541 slidesPerGroup: 4, 542 nextButton: '.swiper-button-next', 543 prevButton: '.swiper-button-prev', 544 breakpoints: { 545 1199: { 546 slidesPerGroup: 2, 547 slidesPerView: 2 548 }, 549 767: { 550 slidesPerGroup: 1, 551 slidesPerView: 1 552 } 553 } 554 }); 555 556 var swiperAutoSlideIndex = 0; 557 var swiperAutoSlide = new Swiper('.swiper-auto-width', { 558 scrollbar: '.swiper-scrollbar', 559 scrollbarHide: false, 560 scrollbarDraggable: true, 561 slidesPerView: 'auto', 562 centeredSlides: true, 563 spaceBetween: 80, 564 preventClicks: false, 565 scrollbarSnapOnRelease: true, 566 nextButton: '.swiper-next-style2', 567 prevButton: '.swiper-prev-style2', 568 mousewheelControl: true, 569 speed: 1000, 570 keyboardControl: true, 571 breakpoints: { 572 1199: { 573 spaceBetween: 60 574 }, 575 960: { 576 spaceBetween: 30 577 }, 578 767: { 579 spaceBetween: 15 580 } 581 }, 582 onSlideChangeEnd: function (swiper) { 583 swiperAutoSlideIndex = swiper.activeIndex; 584 } 585 }); 586 587 var swiperMultipurpose = new Swiper('.swiper-bottom-scrollbar-full', { 588 scrollbar: '.swiper-scrollbar', 589 scrollbarHide: false, 590 scrollbarDraggable: true, 591 slidesPerView: 'auto', 592 scrollbarSnapOnRelease: true, 593 grabCursor: true, 594 preventClicks: false, 595 nextButton: '.swiper-button-next', 596 prevButton: '.swiper-button-prev', 597 mousewheelControl: true, 598 spaceBetween: 30, 599 keyboardControl: true, 600 speed: 1000, 601 breakpoints: { 602 767: { 603 direction: 'vertical', 604 //slidesPerView: 1, 605 scrollbarHide: true, 606 spaceBetween: 0, 607 pagination: false, 608 autoHeight: true 609 } 610 } 611 }); 612 613 var swiperAutoHieght = new Swiper('.swiper-auto-height-container', { 614 nextButton: '.swiper-button-next', 615 prevButton: '.swiper-button-prev', 616 effect: 'fade', 617 loop: true, 618 preventClicks: false, 619 autoHeight: true 620 }); 621 622 var swiperMultyRow = new Swiper('.swiper-multy-row-container', { 623 nextButton: '.swiper-portfolio-next', 624 prevButton: '.swiper-portfolio-prev', 625 slidesPerView: 4, 626 spaceBetween: 15, 627 scrollbarSnapOnRelease: true, 628 autoplay: 3000, 629 autoplayDisableOnInteraction: true, 630 breakpoints: { 631 991: { 632 slidesPerView: 2 633 }, 634 767: { 635 slidesPerView: 1 636 } 637 } 638 }); 639 640 var swiperBlog = new Swiper('.swiper-blog', { 641 slidesPerView: "auto", 642 centeredSlides: true, 643 spaceBetween: 15, 644 scrollbarSnapOnRelease: true, 645 autoplay: 5000, 646 autoplayDisableOnInteraction: true, 647 preventClicks: false, 648 loop: true, 649 loopedSlides: 3 650 }); 651 652 var swiperPresentation = new Swiper('.swiper-presentation', { 653 slidesPerView: 4, 654 centeredSlides: true, 655 spaceBetween: 30, 656 scrollbarSnapOnRelease: true, 657 autoplay: 3000, 658 autoplayDisableOnInteraction: true, 659 preventClicks: true, 660 loop: true, 661 loopedSlides: 6, 662 nextButton: '.swiper-button-next', 663 prevButton: '.swiper-button-prev', 664 breakpoints: { 665 991: { 666 spaceBetween: 15, 667 slidesPerView: 2 668 }, 669 767: { 670 slidesPerView: 1 671 } 672 } 673 }); 674 675 //swiper resize for IE 676 if (isIE()) { 677 setTimeout(function () { 678 $(document).imagesLoaded(function () { 679 if ($(".swiper-full-screen").length > 0) 680 swiperFull.onResize() 681 if ($(".swiper-auto-fade").length > 0) 682 swiperAutoFade.onResize() 683 if ($(".swiper-number-pagination").length > 0) 684 swiperNumber.onResize() 685 if ($(".swiper-slider-clients").length > 0) 686 swiperClients.onResize() 687 if ($(".swiper-slider-second").length > 0) 688 swiperSecond.onResize() 689 if ($(".swiper-slider-third").length > 0) 690 swiperThird.onResize() 691 if ($(".swiper-three-slides").length > 0) 692 swiperThreeSlides.onResize() 693 if ($(".swiper-four-slides").length > 0)
694 swiperFourSlides.onResize() 695 if ($(".swiper-vertical-pagination").length > 0) 696 swiperVerticalPagination.onResize() 697 if ($(".swiper-auto-height-container").length > 0) 698 swiperAutoHieght.onResize() 699 if ($(".swiper-multy-row-container").length > 0) 700 swiperMultyRow.onResize() 701 if ($(".swiper-blog").length > 0) 702 swiperBlog.onResize() 703 if ($(".swiper-swiperPresentation").length > 0) 704 swiperPresentation.onResize() 705 if ($(".swiper-demo-header-style").length > 0) 706 swiperDemoHeaderStyle.onResize() 707 }); 708 }, 300); 709 } 710 711 $(window).resize(function () { 712 setTimeout(function () { 713 if ($(".swiper-full-screen").length > 0) 714 swiperFull.onResize() 715 if ($(".swiper-auto-fade").length > 0) 716 swiperAutoFade.onResize() 717 if ($(".swiper-number-pagination").length > 0) 718 swiperNumber.onResize() 719 if ($(".swiper-slider-clients").length > 0) 720 swiperClients.onResize() 721 if ($(".swiper-slider-second").length > 0) 722 swiperSecond.onResize() 723 if ($(".swiper-slider-third").length > 0) 724 swiperThird.onResize() 725 if ($(".swiper-three-slides").length > 0) 726 swiperThreeSlides.onResize() 727 if ($(".swiper-four-slides").length > 0) 728 swiperFourSlides.onResize() 729 if ($(".swiper-vertical-pagination").length > 0) 730 swiperVerticalPagination.onResize() 731 if ($(".swiper-auto-height-container").length > 0) 732 swiperAutoHieght.onResize() 733 if ($(".swiper-multy-row-container").length > 0) 734 swiperMultyRow.onResize() 735 if ($(".swiper-blog").length > 0) 736 swiperBlog.onResize() 737 if ($(".swiper-swiperPresentation").length > 0) 738 swiperPresentation.onResize() 739 if ($(".swiper-demo-header-style").length > 0) 740 swiperDemoHeaderStyle.onResize() 741 }, 500); 742 743 setTimeout(function () { 744 //destroy swiper 745 var window_width = $(window).width(); 746 if (window_width < 768) { 747 if ($(".swiper-bottom-scrollbar-full").length > 0) { 748 if (swiperMultipurpose) { 749 swiperMultipurpose.detachEvents(); 750 swiperMultipurpose.destroy(true, true); 751 swiperMultipurpose = undefined; 752 } 753 754 swiperMultipurpose = new Swiper('.swiper-bottom-scrollbar-full', { 755 scrollbar: '.swiper-scrollbar', 756 scrollbarHide: false, 757 scrollbarDraggable: true, 758 slidesPerView: 'auto', 759 scrollbarSnapOnRelease: true, 760 grabCursor: true, 761 preventClicks: false, 762 nextButton: '.swiper-button-next', 763 prevButton: '.swiper-button-prev', 764 mousewheelControl: true, 765 spaceBetween: 30, 766 keyboardControl: true, 767 speed: 1000, 768 breakpoints: { 769 767: { 770 direction: 'vertical', 771 //slidesPerView: 1, 772 scrollbarHide: true, 773 spaceBetween: 0, 774 pagination: false, 775 autoHeight: true 776 } 777 } 778 }); 779 } 780 } else { 781 if ($(".swiper-bottom-scrollbar-full").length > 0) { 782 if (swiperMultipurpose) { 783 swiperMultipurpose.detachEvents(); 784 swiperMultipurpose.destroy(true, true); 785 swiperMultipurpose = undefined; 786 } 787 swiperMultipurpose = new Swiper('.swiper-bottom-scrollbar-full', { 788 scrollbar: '.swiper-scrollbar', 789 scrollbarHide: false, 790 scrollbarDraggable: true, 791 slidesPerView: 'auto', 792 scrollbarSnapOnRelease: true, 793 grabCursor: true, 794 preventClicks: false, 795 nextButton: '.swiper-button-next', 796 prevButton: '.swiper-button-prev', 797 mousewheelControl: true, 798 spaceBetween: 30, 799 keyboardControl: true, 800 speed: 1000 801 }); 802 } 803 } 804 }, 500); 805 806 if ($(".swiper-auto-width").length > 0 && swiperAutoSlide) { 807 swiperAutoSlide.detachEvents(); 808 swiperAutoSlide.destroy(true); 809 swiperAutoSlide = undefined; 810 $(".swiper-auto-width .swiper-wrapper").css("transform", "").css("transition-duration", ""); 811 $(".swiper-auto-width .swiper-slide").css("margin-right", ""); 812 813 setTimeout(function () { 814 swiperAutoSlide = new Swiper('.swiper-auto-width', { 815 scrollbar: '.swiper-scrollbar', 816 scrollbarHide: false, 817 scrollbarDraggable: true, 818 slidesPerView: 'auto', 819 centeredSlides: true, 820 spaceBetween: 80, 821 preventClicks: false, 822 scrollbarSnapOnRelease: true, 823 nextButton: '.swiper-next-style2', 824 prevButton: '.swiper-prev-style2', 825 mousewheelControl: true, 826 speed: 1000, 827 keyboardControl: true, 828 breakpoints: { 829 1199: { 830 spaceBetween: 60 831 }, 832 960: { 833 spaceBetween: 30 834 }, 835 767: { 836 spaceBetween: 15 837 } 838 }, 839 onSlideChangeEnd: function (swiper) { 840 swiperAutoSlideIndex = swiper.activeIndex; 841 } 842 }); 843 844 swiperAutoSlide.slideTo(swiperAutoSlideIndex, 1000, false); 845 }, 1000); 846 } 847 }); 848 849 /*============================================================== 850 smooth scroll 851 ==============================================================*/ 852 853 var scrollAnimationTime = 1200, scrollAnimation = 'easeInOutExpo'; 854 $(document).on('click.smoothscroll', 'a.scrollto', function (event) { 855 event.preventDefault(); 856 var target = this.hash; 857 if ($(target).length != 0) { 858 $('html, body').stop() 859 .animate({ 860 'scrollTop': $(target) 861 .offset() 862 .top 863 }, scrollAnimationTime, scrollAnimation, function () { 864 window.location.hash = target; 865 }); 866 } 867 }); 868 869 /*============================================================== 870 humburger menu one page navigation 871 ==============================================================*/ 872 873 if ($('.full-width-pull-menu').length > 0) { 874 $(document).on('click', '.full-width-pull-menu .inner-link', function (e) { 875 //$('body').removeClass('overflow-hidden position-fixed'); 876 $(".full-width-pull-menu .close-button-menu").trigger("click"); 877 var _this = $(this); 878 setTimeout(function () { 879 var target = _this.attr("href"); 880 if ($(target).length > 0) { 881 $('html, body').stop() 882 .animate({ 883 'scrollTop': $(target).offset().top 884 }); 885 } 886 }, 500); 887 }); 888 } 889 890 // Inner links 891 if ($('.navbar-top').length > 0 || $('.navbar-scroll-top').length > 0 || $('.nav-top-scroll').length > 0) { 892 $('.inner-link').smoothScroll({ 893 speed: 900, 894 offset: 0 895 }); 896 } else { 897 $('.inner-link').smoothScroll({ 898 speed: 900, 899 offset: -59 900 }); 901 } 902 903 $('.section-link').smoothScroll({ 904 speed: 900, 905 offset: 1 906 }); 907 908 /*==============================================================*/ 909 //PieChart For Onepage - START CODE 910 /*==============================================================*/ 911 if ($('.chart1').length > 0) { 912 $('.chart1').appear(); 913 $('.chart1').easyPieChart({ 914 barColor: '#929292', 915 trackColor: '#d9d9d9', 916 scaleColor: false, 917 easing: 'easeOutBounce', 918 scaleLength: 1, 919 lineCap: 'round', 920 lineWidth: 3, //12 921 size: 150, //110 922 animate: { 923 duration: 2000,
924 enabled: true 925 }, 926 onStep: function (from, to, percent) { 927 $(this.el).find('.percent').text(Math.round(percent)); 928 } 929 }); 930 $(document.body).on('appear', '.chart1', function (e) { 931 // this code is executed for each appeared element 932 if (!$(this).hasClass('appear')) { 933 $(this).addClass('appear'); 934 $(this).data('easyPieChart').update(0).update($(this).data('percent')); 935 } 936 }); 937 } 938 939 if ($('.chart2').length > 0) { 940 $('.chart2').appear(); 941 $('.chart2').easyPieChart({ 942 easing: 'easeOutCirc', 943 barColor: '#ff214f', 944 trackColor: '#c7c7c7', 945 scaleColor: false, 946 scaleLength: 1, 947 lineCap: 'round', 948 lineWidth: 2, //12 949 size: 120, //110 950 animate: { 951 duration: 2000, 952 enabled: true 953 }, 954 onStep: function (from, to, percent) { 955 $(this.el).find('.percent').text(Math.round(percent)); 956 } 957 }); 958 $(document.body).on('appear', '.chart2', function (e) { 959 // this code is executed for each appeared element 960 if (!$(this).hasClass('appear')) { 961 $(this).addClass('appear'); 962 $(this).data('easyPieChart').update(0).update($(this).data('percent')); 963 } 964 }); 965 } 966 967 if ($('.chart3').length > 0) { 968 $('.chart3').appear(); 969 $('.chart3').easyPieChart({ 970 easing: 'easeOutCirc', 971 barColor: '#ff214f', 972 trackColor: '', 973 scaleColor: false, 974 scaleLength: 1, 975 lineCap: 'round', 976 lineWidth: 3, //12 977 size: 140, //110 978 animate: { 979 duration: 2000, 980 enabled: true 981 }, 982 onStep: function (from, to, percent) { 983 $(this.el).find('.percent').text(Math.round(percent)); 984 } 985 }); 986 $(document.body).on('appear', '.chart3', function (e) { 987 // this code is executed for each appeared element 988 if (!$(this).hasClass('appear')) { 989 $(this).addClass('appear'); 990 $(this).data('easyPieChart').update(0).update($(this).data('percent')); 991 } 992 }); 993 } 994 /*==============================================================*/ 995 //PieChart For Onepage - END CODE 996 /*==============================================================*/ 997 998 /*============================================================== 999 portfolio filter 1000 ==============================================================*/ 1001 var $portfolio_filter = $('.portfolio-grid'); 1002 $portfolio_filter.imagesLoaded(function () { 1003 $portfolio_filter.isotope({ 1004 layoutMode: 'masonry', 1005 itemSelector: '.grid-item', 1006 percentPosition: true, 1007 masonry: { 1008 columnWidth: '.grid-sizer' 1009 } 1010 }); 1011 $portfolio_filter.isotope(); 1012 }); 1013 var $grid_selectors = $('.portfolio-filter > li > a'); 1014 $grid_selectors.on('click', function () { 1015 $grid_selectors.parent().removeClass('active'); 1016 $(this).parent().addClass('active'); 1017 var selector = $(this).attr('data-filter'); 1018 $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting 1019 $portfolio_filter.find('.grid-item').each(function () { 1020 /* remove perticular element from WOW array when you don't want animation on element after DOM lead */ 1021 wow.removeBox(this); 1022 $(this).css("-webkit-animation", "none"); 1023 $(this).css("-moz-animation", "none"); 1024 $(this).css("-ms-animation", "none"); 1025 $(this).css("animation", "none"); 1026 }); 1027 $portfolio_filter.isotope({ filter: selector }); 1028 return false; 1029 }); 1030 $(window).resize(function () { 1031 if (!isMobile && !isiPhoneiPad) { 1032 setTimeout(function () { 1033 $portfolio_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize 1034 $portfolio_filter.isotope('layout'); 1035 }, 300); 1036 } 1037 }); 1038 var $blog_filter = $('.blog-grid'); 1039 $blog_filter.imagesLoaded(function () { 1040 $blog_filter.isotope({ 1041 layoutMode: 'masonry', 1042 itemSelector: '.grid-item', 1043 percentPosition: true, 1044 masonry: { 1045 columnWidth: '.grid-sizer' 1046 } 1047 }); 1048 }); 1049 $(window).resize(function () { 1050 setTimeout(function () { 1051 $blog_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize 1052 $blog_filter.isotope('layout'); 1053 }, 300); 1054 }); 1055 1056 /*============================================================== 1057 lightbox gallery 1058 ==============================================================*/ 1059 $('.lightbox-gallery').magnificPopup({ 1060 delegate: 'a', 1061 type: 'image', 1062 tLoading: 'Loading image #%curr%...', 1063 mainClass: 'mfp-fade', 1064 fixedContentPos: true, 1065 closeBtnInside: false, 1066 gallery: { 1067 enabled: true, 1068 navigateByImgClick: true, 1069 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 1070 } 1071 }); 1072 /* for group gallery */ 1073 var lightboxgallerygroups = {}; 1074 $('.lightbox-group-gallery-item').each(function () { 1075 var id = $(this).attr('data-group'); 1076 if (!lightboxgallerygroups[id]) { 1077 lightboxgallerygroups[id] = []; 1078 } 1079 lightboxgallerygroups[id].push(this); 1080 }); 1081 $.each(lightboxgallerygroups, function () { 1082 $(this).magnificPopup({ 1083 type: 'image', 1084 closeOnContentClick: true, 1085 closeBtnInside: false, 1086 gallery: { enabled: true } 1087 }); 1088 }); 1089 1090 $('.lightbox-portfolio').magnificPopup({ 1091 delegate: '.gallery-link', 1092 type: 'image', 1093 tLoading: 'Loading image #%curr%...', 1094 mainClass: 'mfp-fade', 1095 fixedContentPos: true, 1096 closeBtnInside: false, 1097 gallery: { 1098 enabled: true, 1099 navigateByImgClick: false, 1100 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 1101 } 1102 }); 1103 /*============================================================== 1104 single image lightbox - zoom animation 1105 ==============================================================*/ 1106 $('.single-image-lightbox').magnificPopup({ 1107 type: 'image', 1108 closeOnContentClick: true, 1109 fixedContentPos: true, 1110 closeBtnInside: false, 1111 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 1112 image: { 1113 verticalFit: true 1114 }, 1115 zoom: { 1116 enabled: true, 1117 duration: 300 // don't foget to change the duration also in CSS 1118 } 1119 }); 1120 /*============================================================== 1121 zoom gallery 1122 ==============================================================*/ 1123 $('.zoom-gallery').magnificPopup({ 1124 delegate: 'a', 1125 type: 'image', 1126 mainClass: 'mfp-with-zoom mfp-img-mobile', 1127 fixedContentPos: true, 1128 closeBtnInside: false, 1129 image: { 1130 verticalFit: true, 1131 titleSrc: function (item) { 1132 return item.el.attr('title'); 1133 } 1134 }, 1135 gallery: { 1136 enabled: true 1137 }, 1138 zoom: { 1139 enabled: true, 1140 duration: 300, // don't foget to change the duration also in CSS 1141 opener: function (element) { 1142 return element.find('img'); 1143 } 1144 } 1145 }); 1146 /*==============================================================*/ 1147 //Modal popup - START CODE 1148 /*==============================================================*/ 1149 $('.modal-popup').magnificPopup({ 1150 type: 'inline', 1151 preloader: false, 1152 // modal: true, 1153 blackbg: true 1154 }); 1155 $(document).on('click', '.popup-modal-dismiss', function (e) { 1156 e.preventDefault(); 1157 $.magnificPopup.close(); 1158 }); 1159 /*==============================================================*/ 1160 //Modal popup - END CODE 1161 /*==============================================================*/ 1162 1163 /*==============================================================*/ 1164 //Modal popup - zoom animation - START CODE 1165 /*==============================================================*/ 1166 $('.popup-with-zoom-anim').magnificPopup({ 1167 type: 'inline',
1168 fixedContentPos: false, 1169 fixedBgPos: true, 1170 overflowY: 'auto', 1171 closeBtnInside: true, 1172 preloader: false, 1173 midClick: true, 1174 removalDelay: 300, 1175 blackbg: true, 1176 mainClass: 'my-mfp-zoom-in' 1177 }); 1178 1179 $('.popup-with-move-anim').magnificPopup({ 1180 type: 'inline', 1181 fixedContentPos: false, 1182 fixedBgPos: true, 1183 overflowY: 'auto', 1184 closeBtnInside: true, 1185 preloader: false, 1186 midClick: true, 1187 removalDelay: 300, 1188 blackbg: true, 1189 mainClass: 'my-mfp-slide-bottom' 1190 }); 1191 /*==============================================================*/ 1192 //Modal popup - zoom animation - END CODE 1193 /*==============================================================*/ 1194 1195 /*============================================================== 1196 popup with form 1197 ==============================================================*/ 1198 $('.popup-with-form').magnificPopup({ 1199 type: 'inline', 1200 preloader: false, 1201 closeBtnInside: false, 1202 fixedContentPos: true, 1203 focus: '#name', 1204 callbacks: { 1205 beforeOpen: function () { 1206 if ($(window).width() < 700) { 1207 this.st.focus = false; 1208 } else { 1209 this.st.focus = '#name'; 1210 } 1211 } 1212 } 1213 }); 1214 /*============================================================== 1215 video magnific popup 1216 ==============================================================*/ 1217 1218 $('.popup-youtube, .popup-vimeo, .popup-googlemap').magnificPopup({ 1219 disableOn: 700, 1220 type: 'iframe', 1221 mainClass: 'mfp-fade', 1222 removalDelay: 160, 1223 preloader: false, 1224 fixedContentPos: true, 1225 closeBtnInside: false 1226 }); 1227 /*============================================================== 1228 ajax magnific popup for onepage portfolio 1229 ==============================================================*/ 1230 $('.ajax-popup').magnificPopup({ 1231 type: 'ajax', 1232 alignTop: true, 1233 fixedContentPos: true, 1234 overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump 1235 callbacks: { 1236 open: function () { 1237 $('.navbar .collapse').removeClass('in'); 1238 $('.navbar a.dropdown-toggle').addClass('collapsed'); 1239 } 1240 } 1241 }); 1242 1243 /*============================================================== 1244 mega menu width 1245 ===============================================================*/ 1246 $("ul.mega-menu-full").each(function (idx, elm) { 1247 var megaMenuWidth = 0; 1248 $(this).children('li').each(function (idx, elm) { 1249 var LIheight = 0; 1250 console.log($(this).outerWidth()); 1251 megaMenuWidth += $(this).outerWidth(); 1252 }); 1253 $(this).width(megaMenuWidth + 95); 1254 megaMenuWidth = 0; 1255 }); 1256 /*============================================================== 1257 fit videos 1258 ==============================================================*/ 1259 $(".fit-videos").fitVids(); 1260 1261 1262 /*============================================================== 1263 form to email 1264 ==============================================================*/ 1265 1266 $("#success-subscribe-newsletter").hide(); 1267 $("#success-subscribe-newsletter2").hide(); 1268 $("#success-contact-form").hide(); 1269 $("#success-project-contact-form").hide(); 1270 $("#success-contact-form-2").hide(); 1271 $("#success-contact-form-3").hide(); 1272 $("#success-project-contact-form-4").hide(); 1273 1274 //Subscribe newsletter form 1275 $('#button-subscribe-newsletter').on("click", function () { 1276 var error = ValidationsubscribenewsletterForm(); 1277 if (error) { 1278 $.ajax({ 1279 type: "POST", 1280 url: "email-templates/subscribe-newsletter.php", 1281 data: $("#subscribenewsletterform").serialize(), 1282 success: function (result) { 1283 // Un-comment below code to redirect user to thank you page. 1284 //window.location.href="thank-you.html"; 1285 1286 $('input[type=text],textarea').each(function () { 1287 $(this).val(''); 1288 }) 1289 $("#success-subscribe-newsletter").html(result); 1290 $("#success-subscribe-newsletter").fadeIn("slow"); 1291 $('#success-subscribe-newsletter').delay(4000).fadeOut("slow"); 1292 1293 1294 } 1295 }); 1296 } 1297 }); 1298 1299 function ValidationsubscribenewsletterForm() { 1300 var error = true; 1301 $('#subscribenewsletterform input[type=text]').each(function (index) { 1302 if (index == 0) { 1303 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1304 $("#subscribenewsletterform").find("input:eq(" + index + ")").addClass("required-error"); 1305 error = false;
1306 } else { 1307 $("#subscribenewsletterform").find("input:eq(" + index + ")").removeClass("required-error"); 1308 } 1309 } 1310 1311 }); 1312 return error; 1313 } 1314 1315 $('#button-subscribe-newsletter2').on("click", function () { 1316 var error = ValidationsubscribenewsletterForm2(); 1317 if (error) { 1318 $.ajax({ 1319 type: "POST", 1320 url: "email-templates/subscribe-newsletter.php", 1321 data: $("#subscribenewsletterform2").serialize(), 1322 success: function (result) { 1323 // Un-comment below code to redirect user to thank you page. 1324 //window.location.href="thank-you.html"; 1325 1326 $('input[type=text],textarea').each(function () { 1327 $(this).val(''); 1328 }) 1329 $("#success-subscribe-newsletter2").html(result); 1330 $("#success-subscribe-newsletter2").fadeIn("slow"); 1331 $('#success-subscribe-newsletter2').delay(4000).fadeOut("slow"); 1332 1333 1334 } 1335 }); 1336 } 1337 }); 1338 1339 function ValidationsubscribenewsletterForm2() { 1340 var error = true; 1341 $('#subscribenewsletterform2 input[type=text]').each(function (index) { 1342 if (index == 0) { 1343 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1344 $("#subscribenewsletterform2").find("input:eq(" + index + ")").addClass("required-error"); 1345 error = false; 1346 } else { 1347 $("#subscribenewsletterform2").find("input:eq(" + index + ")").removeClass("required-error"); 1348 } 1349 } 1350 1351 }); 1352 return error; 1353 } 1354 1355 //Contact us form 1356 1357 $('#contact-us-button-form').on("click", function () { 1358 var error = ValidationContactForm(); 1359 1360 if (error) { 1361 1362 $.ajax({ 1363 type: "POST", 1364 url: "email-templates/contact.php", 1365 data: $("#contact-form-form").serializeArray(), 1366 1367 success: function (result) { 1368 // Un-comment below code to redirect user to thank you page. 1369 //window.location.href="thank-you.html"; 1370 1371 $('input[type=text],textarea').each(function () { 1372 $(this).val(''); 1373 }) 1374 $("#success-contact-form").html(result); 1375 $("#success-contact-form").fadeIn("slow"); 1376 $('#success-contact-form').delay(400000).fadeOut("slow"); 1377 } 1378 }); 1379 } 1380 }); 1381 1382 1383 1384 $('#contact-us-button').on("click", function () { 1385 var error = ValidationContactForm(); 1386 if (error) { 1387 //var data = new data($("#formulario-admin")[0]); 1388 $.ajax({ 1389 type: "POST", 1390 url: "email-templates/contact.php", 1391 data: $("#contact-form").serialize(), 1392 success: function (result) { 1393 // Un-comment below code to redirect user to thank you page. 1394 //window.location.href="thank-you.html"; 1395 1396 $('input[type=text],textarea').each(function () { 1397 $(this).val(''); 1398 }) 1399 $("#success-contact-form").html(result); 1400 $("#success-contact-form").fadeIn("slow"); 1401 $('#success-contact-form').delay(4000).fadeOut("slow"); 1402 } 1403 }); 1404 } 1405 }); 1406 1407 function ValidationContactForm() { 1408 var error = true; 1409 $('#contact-form input[type=text], textarea').each(function (index) { 1410 if (index == 0) { 1411 if ($(this).val() == null || $(this).val() == "") { 1412 $("#contact-form").find("input:eq(" + index + ")").addClass("required-error"); 1413 error = false; 1414 } else { 1415 $("#contact-form").find("input:eq(" + index + ")").removeClass("required-error"); 1416 } 1417 } else if (index == 1) { 1418 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1419 $("#contact-form").find("input:eq(" + index + ")").addClass("required-error"); 1420 error = false;
1421 } else { 1422 $("#contact-form").find("input:eq(" + index + ")").removeClass("required-error"); 1423 } 1424 } else if (index == 2) { 1425 if ($(this).val() == null || $(this).val() == "") { 1426 $("#contact-form").find("input:eq(" + index + ")").addClass("required-error"); 1427 error = false; 1428 } else { 1429 $("#contact-form").find("input:eq(" + index + ")").removeClass("required-error"); 1430 } 1431 } else if (index == 3) { 1432 if ($(this).val() == null || $(this).val() == "") { 1433 $("#contact-form").find("textarea:eq(" + index + ")").addClass("required-error"); 1434 error = false; 1435 } else { 1436 $("#contact-form").find("textarea:eq(" + index + ")").removeClass("required-error"); 1437 } 1438 } 1439 1440 }); 1441 1442 $('#formulario-admin input[type=text]').each(function (index) { 1443 if (index == 0 ){ 1444 if ($(this).val() == null || $(this).val() == "") { 1445 $("#formulario-admin").find("input:eq(" + index + ")").addClass("required-error"); 1446 error = false; 1447 } else { 1448 $("#formulario-admin").find("input:eq(" + index + ")").removeClass("required-error"); 1449 } 1450 } else if (index == 1 ){ 1451 if ($(this).val() == null || $(this).val() == "") { 1452 $("#formulario-admin").find("input:eq(" + index + ")").addClass("required-error"); 1453 error = false; 1454 } else { 1455 $("#formulario-admin").find("input:eq(" + index + ")").removeClass("required-error"); 1456 } 1457 } else if (index == 2 ){ 1458 if ($(this).val() == null || $(this).val() == "") { 1459 $("#formulario-admin").find("input:eq(" + index + ")").addClass("required-error"); 1460 error = false; 1461 } else { 1462 $("#formulario-admin").find("input:eq(" + index + ")").removeClass("required-error"); 1463 } 1464 } 1465 1466 }); 1467 1468 return error; 1469 } 1470 1471 1472 1473 1474 1475 1476 1477 //Contact us form 2 1478 1479 $('#contact-us-button-2').on("click", function () { 1480 var error = ValidationContactForm2(); 1481 if (error) { 1482 $.ajax({ 1483 type: "POST", 1484 url: "email-templates/contact.php", 1485 data: $("#contact-form-2").serialize(), 1486 success: function (result) { 1487 // Un-comment below code to redirect user to thank you page. 1488 //window.location.href="thank-you.html"; 1489 1490 $('input[type=text],textarea').each(function () { 1491 $(this).val(''); 1492 }) 1493 $("#success-contact-form-2").html(result); 1494 $("#success-contact-form-2").fadeIn("slow"); 1495 $('#success-contact-form-2').delay(4000).fadeOut("slow"); 1496 } 1497 }); 1498 } 1499 }); 1500 function ValidationContactForm2() { 1501 var error = true; 1502 $('#contact-form-2 input[type=text]').each(function (index) { 1503 if (index == 0) { 1504 if ($(this).val() == null || $(this).val() == "") { 1505 $("#contact-form-2").find("input:eq(" + index + ")").addClass("required-error"); 1506 error = false; 1507 } else { 1508 $("#contact-form-2").find("input:eq(" + index + ")").removeClass("required-error"); 1509 } 1510 } else if (index == 1) { 1511 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1512 $("#contact-form-2").find("input:eq(" + index + ")").addClass("required-error"); 1513 error = false; 1514 } else { 1515 $("#contact-form-2").find("input:eq(" + index + ")").removeClass("required-error"); 1516 } 1517 } 1518 1519 }); 1520 return error; 1521 } 1522 1523 //Contact us form 3 1524 1525 $('#contact-us-button-3').on("click", function () { 1526 var error = ValidationContactForm3(); 1527 if (error) { 1528 $.ajax({ 1529 type: "POST", 1530 url: "email-templates/contact.php", 1531 data: $("#contact-form-3").serialize(), 1532 success: function (result) { 1533 // Un-comment below code to redirect user to thank you page. 1534 //window.location.href="thank-you.html"; 1535 1536 $('input[type=text],textarea').each(function () { 1537 $(this).val(''); 1538 }) 1539 $("#success-contact-form-3").html(result); 1540 $("#success-contact-form-3").fadeIn("slow"); 1541 $('#success-contact-form-3').delay(4000).fadeOut("slow"); 1542 } 1543 }); 1544 } 1545 }); 1546 function ValidationContactForm3() { 1547 var error = true; 1548 $('#contact-form-3 input[type=text]').each(function (index) { 1549 if (index == 0) { 1550 if ($(this).val() == null || $(this).val() == "") { 1551 $("#contact-form-3").find("input:eq(" + index + ")").addClass("required-error"); 1552 error = false;
1553 } else { 1554 $("#contact-form-3").find("input:eq(" + index + ")").removeClass("required-error"); 1555 } 1556 } else if (index == 1) { 1557 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1558 $("#contact-form-3").find("input:eq(" + index + ")").addClass("required-error"); 1559 error = false; 1560 } else { 1561 $("#contact-form-3").find("input:eq(" + index + ")").removeClass("required-error"); 1562 } 1563 } 1564 1565 }); 1566 return error; 1567 } 1568 1569 //Project Contact us form 1570 $('#project-contact-us-button').on("click", function () { 1571 var error = ValidationProjectContactForm(); 1572 if (error) { 1573 $.ajax({ 1574 type: "POST", 1575 url: "email-templates/project-contact.php", 1576 data: $("#project-contact-form").serialize(), 1577 success: function (result) { 1578 // Un-comment below code to redirect user to thank you page. 1579 //window.location.href="thank-you.html"; 1580 1581 $('input[type=text],textarea').each(function () { 1582 $(this).val(''); 1583 }) 1584 $("#success-project-contact-form").html(result); 1585 $("#success-project-contact-form").fadeIn("slow"); 1586 $('#success-project-contact-form').delay(4000).fadeOut("slow"); 1587 } 1588 }); 1589 } 1590 }); 1591 function ValidationProjectContactForm() { 1592 var error = true; 1593 $('#project-contact-form input[type=text]').each(function (index) { 1594 if (index == 0) { 1595 if ($(this).val() == null || $(this).val() == "") { 1596 $("#project-contact-form").find("input:eq(" + index + ")").addClass("required-error"); 1597 error = false; 1598 } else { 1599 $("#project-contact-form").find("input:eq(" + index + ")").removeClass("required-error"); 1600 } 1601 } else if (index == 2) { 1602 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1603 $("#project-contact-form").find("input:eq(" + index + ")").addClass("required-error"); 1604 error = false; 1605 } else { 1606 $("#project-contact-form").find("input:eq(" + index + ")").removeClass("required-error"); 1607 } 1608 } 1609 1610 }); 1611 return error; 1612 } 1613 1614 //Project Contact us form 2 1615 $('#project-contact-us-4-button').on("click", function () { 1616 var error = ValidationProjectContactForm4(); 1617 if (error) { 1618 $.ajax({ 1619 type: "POST", 1620 url: "email-templates/project-contact.php", 1621 data: $("#project-contact-form-4").serialize(), 1622 success: function (result) { 1623 // Un-comment below code to redirect user to thank you page. 1624 //window.location.href="thank-you.html"; 1625 1626 $('input[type=text],textarea').each(function () { 1627 $(this).val(''); 1628 }) 1629 $("#success-project-contact-form-4").html(result); 1630 $("#success-project-contact-form-4").fadeIn("slow"); 1631 $('#success-project-contact-form-4').delay(4000).fadeOut("slow"); 1632 } 1633 }); 1634 } 1635 }); 1636 function ValidationProjectContactForm4() { 1637 var error = true; 1638 $('#project-contact-form-4 input[type=text]').each(function (index) { 1639 if (index == 0) { 1640 if ($(this).val() == null || $(this).val() == "") { 1641 $("#project-contact-form-4").find("input:eq(" + index + ")").addClass("required-error"); 1642 error = false; 1643 } else { 1644 $("#project-contact-form-4").find("input:eq(" + index + ")").removeClass("required-error"); 1645 } 1646 } else if (index == 2) { 1647 if (!(/(.+)@(.+){2,}\.(.+){2,}/.test($(this).val()))) { 1648 $("#project-contact-form-4").find("input:eq(" + index + ")").addClass("required-error"); 1649 error = false;
1650 } else { 1651 $("#project-contact-form-4").find("input:eq(" + index + ")").removeClass("required-error"); 1652 } 1653 } 1654 1655 }); 1656 return error; 1657 } 1658 1659 1660 /*============================================================== 1661 End form to email 1662 ==============================================================*/ 1663 1664 /*============================================================== 1665 wow animation - on scroll 1666 ==============================================================*/ 1667 var wow = new WOW({ 1668 boxClass: 'wow', 1669 animateClass: 'animated', 1670 offset: 0, 1671 mobile: false, 1672 live: true 1673 }); 1674 $(window).imagesLoaded(function () { 1675 wow.init(); 1676 }); 1677 /*============================================================== 1678 counter 1679 ==============================================================*/ 1680 $(function ($) { 1681 animatecounters(); 1682 }); 1683 function animatecounters() { 1684 $('.timer').each(count); 1685 function count(options) { 1686 var $this = $(this); 1687 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 1688 $this.countTo(options); 1689 } 1690 } 1691 /* =================================== 1692 counter number reset while scrolling 1693 ====================================== */ 1694 $('.timer').appear(); 1695 $(document.body).on('appear', '.timer', function (e) { 1696 // this code is executed for each appeared element 1697 if (!$(this).hasClass('appear')) { 1698 animatecounters(); 1699 $(this).addClass('appear'); 1700 } 1701 }); 1702 $('.countdown').countdown($('.countdown').attr("data-enddate")).on('update.countdown', function (event) { 1703 $(this).html(event.strftime('' + '<div class="counter-container"><div class="counter-box first"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="counter-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="counter-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="counter-box last"><div class="number">%S</div><span>Seconds</span></div></div>')) 1704 }); 1705 /* =================================== 1706 left nav 1707 ====================================== */ 1708 $(document).on('click', '.right-menu-button', function (e) { 1709 $('body').toggleClass('left-nav-on'); 1710 }); 1711 /*==============================================================*/ 1712 // hamburger menu 1713 /*==============================================================*/ 1714 $(document).on('click', '.btn-hamburger', function () { 1715 $('.hamburger-menu').toggleClass('show-menu'); 1716 $('body').removeClass('show-menu'); 1717 }); 1718 /*==============================================================*/ 1719 //sidebar nav open 1720 /*==============================================================*/ 1721 $(document).on('click', '#mobileToggleSidenav', function () { 1722 $(this).closest('nav').toggleClass('sidemenu-open'); 1723 }); 1724 /*================================= 1725 //justified Gallery 1726 =================================*/ 1727 $(document).imagesLoaded(function () { 1728 if ($(".justified-gallery").length > 0) { 1729 $(".justified-gallery").justifiedGallery({ 1730 rowHeight: 400, 1731 maxRowHeight: false, 1732 captions: true, 1733 margins: 10, 1734 waitThumbnailsLoad: true 1735 }); 1736 } 1737 }); 1738 1739 $('.atr-nav').on("click", function () { 1740 $(".atr-div").append("<a class='close-cross' href='#'>X</a>"); 1741 $(".atr-div").animate({ 1742 width: "toggle" 1743 }); 1744 }); 1745 1746 $('.close-cross').on("click", function () { 1747 $(".atr-div").hide(); 1748 }); 1749 1750 var menuRight = document.getElementById('cbp-spmenu-s2'), 1751 showRightPush = document.getElementById('showRightPush'), 1752 body = document.body; 1753 if (showRightPush) { 1754 showRightPush.onclick = function () { 1755 classie.toggle(this, 'active'); 1756 if (menuRight) 1757 classie.toggle(menuRight, 'cbp-spmenu-open'); 1758 }; 1759 } 1760 1761 var test = document.getElementById('close-pushmenu'); 1762 if (test) { 1763 test.onclick = function () { 1764 classie.toggle(this, 'active'); 1765 if (menuRight) 1766 classie.toggle(menuRight, 'cbp-spmenu-open'); 1767 }; 1768 } 1769 1770 //blog page header animation 1771 $(".blog-header-style1 li").on('mouseover', function () { 1772 $('.blog-header-style1 li.blog-column-active').removeClass('blog-column-active'); 1773 $(this).addClass('blog-column-active'); 1774 }).on('mouseleave', function () { 1775 $(this).removeClass('blog-column-active'); 1776 $('.blog-header-style1 li:first-child').addClass('blog-column-active'); 1777 }); 1778 /*==============================================================*/ 1779 //big menu open close start 1780 /*==============================================================*/ 1781 $('.big-menu-open').on("click", function () { 1782 $('.big-menu-right').addClass("open"); 1783 }); 1784 $('.big-menu-close').on("click", function () { 1785 $('.big-menu-right').removeClass("open"); 1786 }); 1787 /*==============================================================*/ 1788 //big menu open close end 1789 /*==============================================================*/ 1790 1791 /*============================================================== 1792 instagramfeed 1793 ==============================================================*/ 1794 if ($('#instaFeed-style1').length != 0) { 1795 var instaFeedStyle1 = new Instafeed({ 1796 target: 'instaFeed-style1', 1797 get: 'user', 1798 userId: 5640046896, 1799 limit: '8', 1800 accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0', 1801 resolution: "low_resolution", 1802 error: { 1803 template: '<div class="col-md-12 col-sm-12 col-xs-12"><span class=text-center>No Images Found</span></div>' 1804 }, 1805 template: '<div class="col-md-3 col-sm-6 col-xs-12 instafeed-style1"><a class="insta-link" href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><div class="insta-counts"><span><i class="ti-heart"></i> <span class="count-number">{{likes}}</span></span><span><i class="ti-comment"></i> <span class="count-number">{{comments}}</span></span></div></a></div>' 1806 }); 1807 instaFeedStyle1.run(); 1808 } 1809 1810 if ($('#instaFeed-aside').length != 0) { 1811 var instaFeedAside = new Instafeed({ 1812 target: 'instaFeed-aside', 1813 get: 'user', 1814 userId: 5640046896, 1815 limit: '6', 1816 accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0', 1817 resolution: "low_resolution", 1818 after: function () { 1819 equalizeHeight(); 1820 }, 1821 error: { 1822 template: '<div class="col-md-12 col-sm-12 col-xs-12"><span class=text-center>No Images Found</span></div>' 1823 }, 1824 template: '<li><figure><a href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><span class="insta-counts"><i class="ti-heart"></i>
1824{{likes}}</span></a></figure></li>' 1825 }); 1826 instaFeedAside.run(); 1827 } 1828 1829 if ($('#instaFeed-footer').length != 0) { 1830 var instaFeedFooter = new Instafeed({ 1831 target: 'instaFeed-footer', 1832 get: 'user', 1833 userId: 5640046896, 1834 limit: '6', 1835 accessToken: '5640046896.1677ed0.f7cd85767e124a9f9f8d698cb33252a0', 1836 resolution: "low_resolution", 1837 after: function () { 1838 equalizeHeight(); 1839 }, 1840 error: { 1841 template: '<div class="col-md-12 col-sm-12 col-xs-12"><span class=text-center>No Images Found</span></div>' 1842 }, 1843 template: '<li><figure><a href="{{link}}" target="_blank"><img src="{{image}}" class="insta-image" /><span class="insta-counts"><i class="ti-heart"></i><span>{{likes}}</span></span></a></figure></li>' 1844 }); 1845 instaFeedFooter.run(); 1846 } 1847 /*============================================================== 1848 instagramfeed end 1849 ==============================================================*/ 1850 1851 /*==============================================================*/ 1852 //revolution Start 1853 /*==============================================================*/ 1854 /* ================================ 1855 home-creative-studio 1856 ================================*/ 1857 if ($("#rev_slider_151_1").revolution == undefined) { 1858 revslider_showDoubleJqueryError("#rev_slider_151_1"); 1859 } else { 1860 $("#rev_slider_151_1").show().revolution({ 1861 sliderType: "standard", 1862 jsFileLocation: "revolution/js/", 1863 sliderLayout: "fullscreen", 1864 dottedOverlay: "none", 1865 delay: 9000, 1866 navigation: { 1867 keyboardNavigation: "off", 1868 keyboard_direction: "vertical", 1869 mouseScrollNavigation: "off", 1870 mouseScrollReverse: "default", 1871 onHoverStop: "off", 1872 touch: { 1873 touchenabled: "on", 1874 swipe_threshold: 75, 1875 swipe_min_touches: 1, 1876 swipe_direction: "horizontal", 1877 drag_block_vertical: false 1878 }, 1879 arrows: { 1880 style: "uranus", 1881 enable: true, 1882 hide_onmobile: false, 1883 hide_over: 479, 1884 hide_onleave: false, 1885 tmp: '', 1886 left: { 1887 h_align: "left", 1888 v_align: "center", 1889 h_offset: 0, 1890 v_offset: 0 1891 }, 1892 right: { 1893 h_align: "right", 1894 v_align: "center", 1895 h_offset: 0, 1896 v_offset: 0 1897 } 1898 } 1899 }, 1900 responsiveLevels: [1240, 1024, 778, 480], 1901 visibilityLevels: [1240, 1024, 778, 480], 1902 gridwidth: [1240, 1024, 778, 480], 1903 gridheight: [868, 768, 960, 720], 1904 lazyType: "none", 1905 scrolleffect: { 1906 blur: "on", 1907 maxblur: "20", 1908 on_slidebg: "on", 1909 direction: "top", 1910 multiplicator: "2", 1911 multiplicator_layers: "2", 1912 tilt: "10", 1913 disable_on_mobile: "off" 1914 }, 1915 parallax: { 1916 type: "scroll", 1917 origo: "slidercenter", 1918 speed: 400, 1919 levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 51, 55] 1920 }, 1921 shadow: 0, 1922 spinner: "spinner3", 1923 stopLoop: "off", 1924 stopAfterLoops: -1, 1925 stopAtSlide: -1, 1926 shuffle: "off", 1927 autoHeight: "off", 1928 fullScreenAutoWidth: "off", 1929 fullScreenAlignForce: "off", 1930 fullScreenOffsetContainer: "", 1931 fullScreenOffset: "0px", 1932 hideThumbsOnMobile: "off", 1933 hideSliderAtLimit: 0, 1934 hideCaptionAtLimit: 0, 1935 hideAllCaptionAtLilmit: 0, 1936 debugMode: false, 1937 fallbacks: { 1938 simplifyAll: "off", 1939 nextSlideOnWindowFocus: "off", 1940 disableFocusListener: false 1941 } 1942 }); 1943 } 1944 /* ================================ 1945 home-classic-web-agency 1946 ================================*/ 1947 if ($("#rev_slider_1174_1").revolution == undefined) { 1948 revslider_showDoubleJqueryError("#rev_slider_1174_1"); 1949 } else { 1950 $("#rev_slider_1174_1").show().revolution({ 1951 sliderType: "hero", 1952 jsFileLocation: "revolution/js/", 1953 sliderLayout: "fullscreen", 1954 dottedOverlay: "none", 1955 delay: 9000, 1956 navigation: { 1957 }, 1958 responsiveLevels: [1240, 1024, 778, 480], 1959 visibilityLevels: [1240, 1024, 778, 480], 1960 gridwidth: [1240, 1024, 778, 480], 1961 gridheight: [868, 768, 960, 720], 1962 lazyType: "none", 1963 parallax: { 1964 type: "scroll", 1965 origo: "slidercenter", 1966 speed: 400, 1967 levels: [10, 15, 20, 25, 30, 35, 40, -10, -15, -20, -25, -30, -35, -40, -45, 55] 1968 }, 1969 shadow: 0, 1970 spinner: "off", 1971 autoHeight: "off", 1972 fullScreenAutoWidth: "off", 1973 fullScreenAlignForce: "off", 1974 fullScreenOffsetContainer: "", 1975 disableProgressBar: "on", 1976 hideThumbsOnMobile: "off", 1977 hideSliderAtLimit: 0, 1978 hideCaptionAtLimit: 0, 1979 hideAllCaptionAtLilmit: 0, 1980 debugMode: false, 1981 fallbacks: { 1982 simplifyAll: "off", 1983 disableFocusListener: false 1984 } 1985 }); 1986 } 1987 1988 /* ================================ 1989 home-classic-corporate 1990 ================================*/ 1991 if ($("#rev_slider_1078_1").revolution == undefined) { 1992 revslider_showDoubleJqueryError("#rev_slider_1078_1"); 1993 } else { 1994 $("#rev_slider_1078_1").show().revolution({ 1995 sliderType: "standard", 1996 jsFileLocation: "revolution/js/", 1997 sliderLayout: "fullscreen", 1998 dottedOverlay: "none", 1999 delay: 9000, 2000 navigation: { 2001 keyboardNavigation: "on", 2002 keyboard_direction: "horizontal", 2003 mouseScrollNavigation: "off", 2004 mouseScrollReverse: "default", 2005 onHoverStop: "off", 2006 touch: { 2007 touchenabled: "on", 2008 swipe_threshold: 75, 2009 swipe_min_touches: 1, 2010 swipe_direction: "horizontal", 2011 drag_block_vertical: false 2012 } 2013 , 2014 arrows: { 2015 style: "zeus", 2016 enable: true, 2017 hide_onmobile: true, 2018 hide_under: 600, 2019 hide_onleave: true, 2020 hide_delay: 200, 2021 hide_delay_mobile: 1200, 2022 tmp: '<div class="tp-title-wrap"> <div class="tp-arr-imgholder"></div> </div>', 2023 left: { 2024 h_align: "left", 2025 v_align: "center", 2026 h_offset: 30, 2027 v_offset: 0 2028 }, 2029 right: { 2030 h_align: "right", 2031 v_align: "center", 2032 h_offset: 30, 2033 v_offset: 0 2034 } 2035 } 2036 , 2037 bullets: { 2038 enable: true, 2039 hide_onmobile: false, 2040 hide_under: 300, 2041 style: "hermes", 2042 hide_onleave: false, 2043 hide_delay: 200, 2044 hide_delay_mobile: 1200, 2045 direction: "horizontal", 2046 h_align: "center", 2047 v_align: "bottom", 2048 h_offset: 0, 2049 v_offset: 30, 2050 space: 8, 2051 tmp: '<span class="tp-bullet-img-wrap"> <span class="tp-bullet-image"></span></span><span class="tp-bullet-title">{{title}}</span>' 2052 } 2053 }, 2054 viewPort: { 2055 enable: true, 2056 outof: "pause", 2057 visible_area: "80%", 2058 presize: false 2059 }, 2060 responsiveLevels: [1240, 1024, 778, 480], 2061 visibilityLevels: [1240, 1024, 778, 480], 2062 gridwidth: [1240, 1024, 778, 480], 2063 gridheight: [600, 600, 500, 400], 2064 lazyType: "none", 2065 parallax: { 2066 type: "mouse", 2067 origo: "slidercenter", 2068 speed: 2000,
2069 levels: [2, 3, 4, 5, 6, 7, 12, 16, 10, 50, 46, 47, 48, 49, 50, 55] 2070 }, 2071 shadow: 0, 2072 spinner: "off", 2073 stopLoop: "off", 2074 stopAfterLoops: -1, 2075 stopAtSlide: -1, 2076 shuffle: "off", 2077 autoHeight: "off", 2078 hideThumbsOnMobile: "off", 2079 hideSliderAtLimit: 0, 2080 hideCaptionAtLimit: 0, 2081 hideAllCaptionAtLilmit: 0, 2082 debugMode: false, 2083 fallbacks: { 2084 simplifyAll: "off", 2085 nextSlideOnWindowFocus: "off", 2086 disableFocusListener: false 2087 } 2088 }); 2089 } 2090 /*==============================================================*/ 2091 //revolution End 2092 /*==============================================================*/ 2093 2094 /*==============================================================*/ 2095 //magnificPopup Start 2096 /*==============================================================*/ 2097 $('.header-search-form').magnificPopup({ 2098 mainClass: 'mfp-fade', 2099 closeOnBgClick: true, 2100 preloader: false, 2101 // for white backgriund 2102 fixedContentPos: false, 2103 closeBtnInside: false, 2104 callbacks: { 2105 open: function () { 2106 setTimeout(function () { 2107 $('.search-input').focus(); 2108 }, 500); 2109 $('#search-header').parent().addClass('search-popup'); 2110 if (!isMobile) { 2111 $('body').addClass('overflow-hidden'); 2112 //$('body').addClass('position-fixed'); 2113 $('body').addClass('width-100'); 2114 document.onmousewheel = ScrollStop; 2115 } else { 2116 $('body, html').on('touchmove', function (e) { 2117 e.preventDefault(); 2118 }); 2119 } 2120 }, 2121 close: function () { 2122 if (!isMobile) { 2123 $('body').removeClass('overflow-hidden'); 2124 //$('body').removeClass('position-fixed'); 2125 $('body').removeClass('width-100'); 2126 $('#search-header input[type=text]').each(function (index) { 2127 if (index == 0) { 2128 $(this).val(''); 2129 $("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)" }); 2130 } 2131 }); 2132 document.onmousewheel = ScrollStart; 2133 } else { 2134 $('body, html').unbind('touchmove'); 2135 } 2136 } 2137 } 2138 }); 2139 2140 /*==============================================================*/ 2141 //magnificPopup End 2142 /*==============================================================*/ 2143 $("input.search-input").on("keypress", function (event) { 2144 if (event.which == 13 && !isMobile) { 2145 $("button.search-button").trigger("click"); 2146 event.preventDefault(); 2147 } 2148 }); 2149 2150 $("input.search-input").on("keyup", function (event) { 2151 if ($(this).val() == null || $(this).val() == "") { 2152 $(this).css({ "border": "none", "border-bottom": "2px solid red" }); 2153 } else { 2154 $(this).css({ "border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)" }); 2155 } 2156 }); 2157 2158 $("form.search-form, form.search-form-result").submit(function (event) { 2159 var error = validationSearchForm(); 2160 if (error) { 2161 var action = $(this).attr('action'); 2162 action = action == '#' || action == '' ? 'blog-grid-3columns.html' : action; 2163 action = action + '?' + $(this).serialize(); 2164 window.location = action; 2165 } 2166 2167 event.preventDefault(); 2168 }); 2169 2170 $(document).on("click", '.navbar .navbar-collapse a.dropdown-toggle, .accordion-style1 .panel-heading a, .accordion-style2 .panel-heading a, .accordion-style3 .panel-heading a, .toggles .panel-heading a, .toggles-style2 .panel-heading a, .toggles-style3 .panel-heading a, a.carousel-control, .nav-tabs a[data-toggle="tab"], a.shopping-cart', function (e) { 2171 e.preventDefault(); 2172 }); 2173 2174 $('body').on('touchstart click', function (e) { 2175 if ($(window).width() < 992) { 2176 if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse').hasClass('in') && !$(e.target).hasClass('navbar-toggle')) { 2177 $('.navbar-collapse').collapse('hide'); 2178 } 2179 } else { 2180 if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse ul').hasClass('in')) { 2181 console.log(this); 2182 $('.navbar-collapse').find('a.dropdown-toggle').addClass('collapsed'); 2183 $('.navbar-collapse').find('ul.dropdown-menu').removeClass('in'); 2184 $('.navbar-collapse a.dropdown-toggle').removeClass('active'); 2185 } 2186 } 2187 }); 2188 2189 $('.navbar-collapse a.dropdown-toggle').on('touchstart', function (e) { 2190 $('.navbar-collapse a.dropdown-toggle').not(this).removeClass('active'); 2191 if ($(this).hasClass('active')) 2192 $(this).removeClass('active'); 2193 else 2194 $(this).addClass('active'); 2195 }); 2196 2197 $('button.navbar-toggle').on("click", function (e) { 2198 if (isMobile) { 2199 $(".cart-content").css('opacity', '0'); 2200 $(".cart-content").css('visibility', 'hidden'); 2201 } 2202 }); 2203 2204 $('a.dropdown-toggle').on("click", function (e) { 2205 if (isMobile) { 2206 $(".cart-content").css('opacity', '0'); 2207 $(".cart-content").css('visibility', 'hidden'); 2208 } 2209 }); 2210 2211 $(document).on('click', '.navbar-collapse [data-toggle="dropdown"]', function (event) { 2212 2213 var $innerLinkLI = $(this).parents('ul.navbar-nav').find('li.dropdown a.inner
2213-link').parent('li.dropdown'); 2214 if (!$(this).hasClass('inner-link') && $innerLinkLI.hasClass('open')) { 2215 $innerLinkLI.removeClass('open'); 2216 } 2217 var target = $(this).attr('target'); 2218 if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').indexOf("#") <= -1 && !$(event.target).is('i')) { 2219 if (event.ctrlKey || event.metaKey) { 2220 window.open($(this).attr('href'), "_blank"); 2221 return false; 2222 } else if (!target) 2223 window.location = $(this).attr('href'); 2224 else 2225 window.open($(this).attr('href'), target); 2226 2227 } else if ($(window).width() > 991 && $(this).attr('href').indexOf("#") <= -1) { 2228 if (event.ctrlKey || event.metaKey) { 2229 window.open($(this).attr('href'), "_blank"); 2230 return false; 2231 } else if (!target) 2232 window.location = $(this).attr('href'); 2233 else 2234 window.open($(this).attr('href'), target); 2235 2236 } else if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').length > 1 && $(this).attr('href').indexOf("#") >= 0 && $(this).hasClass('inner-link')) { 2237 $(this).parents('ul.navbar-nav').find('li.dropdown').not($(this).parent('.dropdown')).removeClass('open'); 2238 if ($(this).parent('.dropdown').hasClass('open')) { 2239 $(this).parent('.dropdown').removeClass('open'); 2240 } else { 2241 $(this).parent('.dropdown').addClass('open'); 2242 } 2243 $(this).toggleClass('active'); 2244 } 2245 }); 2246 2247 /* =================================== 2248 skillbar 2249 ====================================== */ 2250 $('.skillbar').appear(); 2251 $('.skillbar').skillBars({ 2252 from: 0, 2253 speed: 4000, 2254 interval: 100, 2255 decimals: 0 2256 }); 2257 2258 $(document.body).on('appear', '.skillbar', function (e) { 2259 // this code is executed for each appeared element 2260 if (!$(this).hasClass('appear')) { 2261 $(this).addClass('appear'); 2262 $(this).find('.skillbar-bar').css("width", "0%"); 2263 $(this).skillBars({ 2264 from: 0, 2265 speed: 4000, 2266 interval: 100, 2267 decimals: 0 2268 }); 2269 } 2270 }); 2271 /* =================================== 2272 touchstart click 2273 ====================================== */ 2274 $('body').on('touchstart click', function (e) { 2275 if ($(window).width() < 992) { 2276 } 2277 }); 2278 /*==============================================================*/ 2279 //Set Resize Header Menu - START CODE 2280 /*==============================================================*/ 2281 $('nav.full-width-pull-menu ul.panel-group li.dropdown a.dropdown-toggle').on("click", function (e) { 2282 if ($(this).parent('li').find('ul.dropdown-menu').length > 0) { 2283 if ($(this).parent('li').hasClass('open')) { 2284 $(this).parent('li').removeClass('open'); 2285 } else { 2286 $(this).parent('li').addClass('open'); 2287 } 2288 } 2289 }); 2290 /*==============================================================*/ 2291 //accordion - START CODE 2292 /*==============================================================*/ 2293 $('.accordion-style1 .collapse').on('show.bs.collapse', function () { 2294 var id = $(this).attr('id'); 2295 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 2296 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>'); 2297 }); 2298 2299 $('.accordion-style1 .collapse').on('hide.bs.collapse', function () { 2300 var id = $(this).attr('id'); 2301 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 2302 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>'); 2303 }); 2304 2305 $('.nav.navbar-nav a.inner-link').on("click", function (e) { 2306 $(this).parents('ul.navbar-nav').find('a.inner-link').removeClass('active'); 2307 var $this = $(this); 2308 if ($('.nav-header-container .navbar-toggle').is(':visible')) 2309 $(this).parents('.navbar-collapse').collapse('hide'); 2310 setTimeout(function () { 2311 $this.addClass('active'); 2312 }, 1000); 2313 2314 }); 2315 2316 $('.accordion-style2 .collapse').on('show.bs.collapse', function () { 2317 var id = $(this).attr('id'); 2318 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 2319 $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); 2320 }); 2321 2322 $('.accordion-style2 .collapse').on('hide.bs.collapse', function () { 2323 var id = $(this).attr('id'); 2324 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 2325 $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); 2326 }); 2327 2328 $('.accordion-style3 .collapse').on('show.bs.collapse', function () { 2329 var id = $(this).attr('id'); 2330 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 2331 $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); 2332 }); 2333 2334 $('.accordion-style3 .collapse').on('hide.bs.collapse', function () { 2335 var id = $(this).attr('id'); 2336 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 2337 $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); 2338 }); 2339 /*==============================================================*/ 2340 //accordion - END CODE 2341 /*==============================================================*/ 2342 2343 /*==============================================================*/ 2344 //toggles - START CODE 2345 /*==============================================================*/ 2346 $('.toggles .collapse').on('show.bs.collapse', function () { 2347 var id = $(this).attr('id'); 2348 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 2349 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>'); 2350 }); 2351 2352 $('.toggles .collapse').on('hide.bs.collapse', function () { 2353 var id = $(this).attr('id'); 2354 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 2355 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>'); 2356 }); 2357 2358 $('.toggles-style2 .collapse').on('show.bs.collapse', function () { 2359 var id = $(this).attr('id'); 2360 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 2361 $('a[href="#' + id + '"] .panel-title span').html('<i class="fa fa-angle-up"></i>'); 2362 }); 2363 2364 $('.toggles-style2 .collapse').on('hide.bs.collapse', function () { 2365 var id = $(this).attr('id'); 2366 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 2367 $('a[href="#' + id + '"] .panel-title span').html('<i class="fa fa-angle-down"></i>'); 2368 }); 2369 /*==============================================================*/ 2370 //toggles - END CODE 2371 /*==============================================================*/ 2372 2373 2374 /* =================================== 2375 blog hover box 2376 ====================================== */ 2377 $(document).on("mouseenter", ".blog-post-style4 .grid-item", function (e) { 2378 $(this).find("figcaption .blog-hover-text").slideDown(300); 2379 }); 2380 $(document).on("mouseleave", ".blog-post-style4 .grid-item", function (e) { 2381 $(this).find("figcaption .blog-hover-text").slideUp(300); 2382 }); 2383 /* =================================== 2384 End blog hover box 2385 ====================================== */ 2386 SetResizeContent(); 2387 2388 var $allNonRatinaImages = $("img:not([data-at2x])"); 2389 $allNonRatinaImages.attr('data-no-retina', ''); 2390 2391 /*==============================================================*/ 2392 //demo button - START CODE 2393 /*==============================================================*/ 2394 2395// var $buythemediv = '<div class="buy-theme alt-font sm-display-none">
2395<a href="https://themeforest.net/item/pofo-creative-agency-corporate-and-portfolio-multipurpose-template/20645944?ref=themezaa" target="_blank"><i class="ti-shopping-cart"></i><span>Buy Theme</span></a></div><div class="all-demo alt-font sm-display-none"><a href="mailto:[email protected]?subject=POFO â Creative Agency, Corporate and Portfolio Multi-purpose Template - Quick Question"><i class="ti-email"></i><span>Quick Question?</span></a></div>'; 2396// $('body').append($buythemediv); 2397 2398 /*==============================================================*/ 2399 //demo button - END CODE 2400 /*==============================================================*/ 2401 2402}); 2403/* =================================== 2404END READY 2405====================================== */ 2406 2407 2408/* =================================== 2409START Page Load 2410====================================== */ 2411$(window).load(function () { 2412 var hash = window.location.hash.substr(1); 2413 if (hash != "") { 2414 setTimeout(function () { 2415 $(window).imagesLoaded(function () { 2416 var scrollAnimationTime = 1200, 2417 scrollAnimation = 'easeInOutExpo'; 2418 var target = '#' + hash; 2419 if ($(target).length > 0) { 2420 2421 $('html, body').stop() 2422 .animate({ 2423 'scrollTop': $(target).offset().top 2424 }, scrollAnimationTime, scrollAnimation, function () { 2425 window.location.hash = target; 2426 }); 2427 } 2428 }); 2429 }, 500); 2430 } 2431}); 2432/* =================================== 2433END Page Load 2434====================================== */ 2435 2436 2437
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.