1"use strict"; 2 3var isMobile = false; 4var isiPhoneiPad = false; 5 6if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 7 isMobile = true; 8} 9 10if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 11 isiPhoneiPad = true; 12} 13 14/* For remove conflict */ 15( function( $ ) { 16 17 var swiperObjs = []; 18 19 /* Remove cookie policy on page load if page is cached */ 20 var gdpr_cookie_name = 'pofo_gdpr_cookie_notice_accepted'+pofoMain.site_id; 21 if( typeof getPofoCookie( gdpr_cookie_name ) != 'undefined' && getPofoCookie(gdpr_cookie_name) ){ 22 $('.pofo-cookie-policy-wrapper').remove(); 23 } 24 $( window ).on( 'load', function () { 25 /* =================================== 26 set full screen height 27 ====================================== */ 28 29 SetResizeContent(); 30 31 pofoParallax(); 32 33 SetMegamenuPosition(); 34 35 /* =================================== 36 START Page Load 37 ====================================== */ 38 var hash = window.location.hash.substr(1); 39 if (hash != "") { 40 setTimeout(function () { 41 $(window).imagesLoaded(function () { 42 var scrollAnimationTime = 1200, 43 scrollAnimation = 'easeInOutExpo'; 44 var target = '#' + hash; 45 var tabname = 'pofotabitem-'; 46 if( target.indexOf( tabname ) != -1){ 47 var value = ( $(target).offset().top ) - 200; 48 } else { 49 var value = $(target).offset().top; 50 } 51 if ($(target).length > 0) { 52 53 $('html, body').stop() 54 .animate({ 55 'scrollTop': value 56 }, scrollAnimationTime, scrollAnimation, function () { 57 window.location.hash = target; 58 }); 59 } 60 }); 61 }, 500); 62 } 63 /* =================================== 64 END Page Load 65 ====================================== */ 66 67 /****** Reset swiper loop ******/ 68 setTimeout( function() { 69 resetSwiperLoop(); 70 }, 200 ); 71 }); 72 73 function SetMegamenuPosition() { 74 75 $("ul.navbar-nav li.megamenu-fw").each(function () { 76 var offset = $(this).offset(); 77 var totalHeight = offset.top + $(this).outerHeight(true); 78 $(this).find('ul.mega-menu').css({top: totalHeight}); 79 }); 80 } 81 82 function pad(d) { 83 return (d < 10) ? '0' + d.toString() : d.toString(); 84 } 85 86 function isIE() { 87 88 var ua = window.navigator.userAgent; 89 var msie = ua.indexOf("MSIE "); 90 91 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number 92 { 93 return true; 94 } 95 else // If another browser, return 0 96 { 97 return false; 98 } 99 100 return false; 101 } 102 103 function setMobileHeight(){ 104 if( isMobile ) { 105 if( $('.vc_row-o-full-height').length > 0 ) { 106 setTimeout(function () { 107 var windowHeight = $(window).height(); 108 $('.vc_row-o-full-height').css('min-height', windowHeight); 109 }, 500); 110 } 111 } 112 } 113 114 //page title space 115 function setPageTitleSpace() { 116 if( $('.navbar').hasClass('navbar-top') || $('nav').hasClass('navbar-fixed-top') || $('nav').hasClass('navbar-non-sticky-top') || $('nav').hasClass('full-width-pull-menu') ) { 117 if ($('.top-space').length > 0) { 118 var top_space_height = $('.navbar').outerHeight(); 119 if( $('.top-header-area').length > 0 ) { 120 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 121 } 122 $('.top-space').css('margin-top', top_space_height + "px"); 123 } 124 } 125 if( $('.sidebar-nav-style-1 .sidenav-header').length > 0 ) { 126 if( $('.sidebar-nav-style-1').hasClass('mobile-left-menu') ) { 127 if ($('.top-space').length > 0) { 128 var top_space_height = $('.mobile-left-menu .sidenav-header').outerHeight(); 129 if( $('.top-header-area').length > 0 ) { 130 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 131 } 132 $('.top-space').css('margin-top', top_space_height + "px"); 133 } 134 } else { 135 var top_space_height = 0; 136 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 137 $('.top-space').css('margin-top', top_space_height + "px"); 138 } 139 } 140 if( $('.left-nav').length > 0 ) { 141 if( $('.left-nav').hasClass('mobile-left-menu') ) { 142 if ($('.top-space').length > 0) { 143 var top_space_height = $('.mobile-left-menu').outerHeight(); 144 if( $('.top-header-area').length > 0 ) { 145 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 146 } 147 $('.top-space').css('margin-top', top_space_height + "px"); 148 } 149 } else { 150 var top_space_height = 0; 151 top_space_height = top_space_height + $('.top-header-area').outerHeight(); 152 $('.top-space').css('margin-top', top_space_height + "px"); 153 } 154 } 155 } 156 157 /* Set Pofo Cookie Function */ 158 function setPofoCookie(cname, cvalue, exdays) { 159 var d = new Date(); 160 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 161 var expires = ( exdays != 0 && exdays != '' ) ? d.toUTCString() : 0; 162 document.cookie = cname + "=" + cvalue + ";expires=" + expires + ";path=/"; 163 } 164 165 /* Remove Pofo Cookie Function */ 166 function getPofoCookie(cname) { 167 var name = cname + "="; 168 var decodedCookie = decodeURIComponent(document.cookie); 169 var ca = decodedCookie.split(';'); 170 for(var i = 0; i <ca.length; i++) { 171 var c = ca[i]; 172 while (c.charAt(0) == ' ') { 173 c = c.substring(1); 174 } 175 if (c.indexOf(name) == 0) { 176 return c.substring(name.length, c.length); 177 } 178 } 179 return ""; 180 } 181 182 $(document).ready(function () { 183 184 setupSwiper(); 185 destroySwiperLoop(); 186 187 // Start For Direct url tab id 188 function onHashChange() { 189 var hash = window.location.hash; 190 var tabname = 'pofotabitem-'; 191 if( hash && hash.indexOf( tabname ) != -1 ){ 192 // using ES6 template string syntax 193 $( '[data-toggle="tab"][href="'+hash+'"]' ).trigger( 'click' ); 194 } 195 } 196 197 var gdpr_cookie_name = 'pofo_gdpr_cookie_notice_accepted'+pofoMain.site_id; 198 if( typeof getPofoCookie( gdpr_cookie_name ) != 'undefined' && getPofoCookie(gdpr_cookie_name) ){ 199 $('.pofo-cookie-policy-wrapper').addClass('banner-visited'); 200 $('.pofo-cookie-policy-wrapper').remove(); 201 }else{ 202 $('.pofo-cookie-policy-wrapper').removeClass('banner-visited'); 203 } 204 $('.pofo-cookie-policy-button').on('click', function(){ 205 $('.pofo-cookie-policy-wrapper').remove(); 206 setPofoCookie( gdpr_cookie_name, 'visited', '7' ); 207 }); 208 209 window.addEventListener('hashchange', onHashChange, false); 210 onHashChange(); 211 // End For Direct url tab id 212 213 // Stop click event for input field into bootstrap menu 214 $( '.bootsnav input' ).bind( 'click', function (e) {e.stopPropagation() }); 215 216 /* For Stretch Effect */ 217 $( 'body' ).addClass('pofo-ready'); 218 219 if( $( '.pofo-featurebox' ).length > 0 ) { 220 if( $( '.pofo-featurebox' ).parents( '.vc_row' ).hasClass( 'vc_inner' ) ) { 221 $( '.pofo-featurebox' ).parents( '.vc_inner' ).addClass( 'pofo-featurebox-equal-height' ); 222 } else { 223 $( '.pofo-featurebox' ).parents( '.vc_row' ).addClass( 'pofo-featurebox-equal-height' ); 224 } 225 } 226 227 SetResizeContent(); 228 229 feature_dynamic_font_line_height(); 230 231 setButtonPosition(); 232 233 init_scroll_navigate(); 234 235 CenterLogoHeight(); 236 237 /* Add Clear both class in VC front editor column */ 238 239 $( '.wpb_column' ).each(function () { 240 var CurrentColumn = $(this); 241 var DataClearBoth = $(this).attr( 'data-clear-both' ); 242 if( DataClearBoth && $( 'body').hasClass( 'vc_editor' ) ){ 243 CurrentColumn.parent().addClass( DataClearBoth ); 244 CurrentColumn.removeClass( DataClearBoth ); 245 } 246 CurrentColumn.removeAttr( 'data-clear-both' ); 247 }); 248 249 250 // If page has no section 251 if( $("body.page > .type-page").find(".entry-content section.vc_row").length == 0 ){ 252 $("body.page > .type-page").addClass("default-page-space"); 253 }else{ 254 $("body.page > .type-page").removeClass("default-page-space"); 255 } 256 257 //blog page header animation 258 $(".blog-header-style1 li").on('mouseover', function () { 259 $('.blog-header-style1 li.blog-column-active').removeClass('blog-column-active'); 260 $(this).addClass('blog-column-active'); 261 }).on('mouseleave', function () { 262 $(this).removeClass('blog-column-active'); 263 $('.blog-header-style1 li:first-child').addClass('blog-column-active'); 264 }); 265 266 // Bootsnav menu work with eualize height 267 $("nav.navbar.bootsnav ul.nav").each(function () { 268 $("li.dropdown", this).on("mouseenter", function () { 269 equalizeHeight(); 270 return false;
271 }); 272 }); 273 274 // Bootsnav tab work with eualize height 275 $('a[data-toggle="tab"]').on('shown.bs.tab', function () { 276 equalizeHeight(); 277 return false; 278 }); 279 280 $(window).scroll(function () { 281 if ($(this).scrollTop() > 150) 282 $('.scroll-top-arrow').fadeIn('slow'); 283 else 284 $('.scroll-top-arrow').fadeOut('slow'); 285 }); 286 287 //Click event to scroll to top 288 $('.scroll-top-arrow').on('click', function () { 289 $('html, body').animate({scrollTop: 0}, 800); 290 return false; 291 }); 292 293 // Add sidebar class to widgetized sidebar vc 294 var sidebar_widget = $(".wpb_column").find("div"); 295 if( sidebar_widget.hasClass("wpb_widgetised_column") ){ 296 $(".wpb_widgetised_column").addClass("sidebar"); 297 } 298 299 /*============================================================== 300 smooth scroll 301 ==============================================================*/ 302 303 var scrollAnimationTime = 1200, scrollAnimation = 'easeInOutExpo'; 304 $(document).on('click.smoothscroll', 'a.scrollto', function (event) { 305 event.preventDefault(); 306 var target = this.hash; 307 if ($(target).length != 0) { 308 $('html, body').stop() 309 .animate({ 310 'scrollTop': $(target) 311 .offset() 312 .top 313 }, scrollAnimationTime, scrollAnimation, function () { 314 window.location.hash = target; 315 }); 316 } 317 }); 318 319 // Inner links 320 if ($('.navbar-top').length > 0 || $('.navbar-scroll-top').length > 0 || $('.nav-top-scroll').length > 0) { 321 322 $('.inner-link').smoothScroll({ 323 speed: 900, 324 offset: 0, 325 beforeScroll: function() { $( '#close-button' ).trigger( 'click' ); } 326 }); 327 328 } else if( $(window).width() <= pofoMain.menu_breakpoint && $('.sidebar-nav-style-1 #mobileToggleSidenav').length > 0 ) { // Left menu classic 329 330 $('.inner-link').smoothScroll({ 331 speed: 900, 332 offset: -59, 333 beforeScroll: function() { $( '.sidebar-nav-style-1 #mobileToggleSidenav' ).trigger( 'click' ); } 334 }); 335 336 } else if( $(window).width() <= pofoMain.menu_breakpoint && $('.left-nav-sidebar .sidebar-part3').length > 0 ) { // Left menu modern 337 338 $('.inner-link').smoothScroll({ 339 speed: 900, 340 offset: -44, 341 beforeScroll: function() { $( '.sidebar-nav-style-1 #mobileToggleSidenav' ).trigger( 'click' ); } 342 }); 343 344 } else { 345 346 $('.inner-link').smoothScroll({ 347 speed: 900, 348 offset: 0, 349 beforeScroll: function() { $( '#close-button' ).trigger( 'click' ); } 350 }); 351 } 352 353 // Down section links 354 if ($('.navbar-fixed-top').length > 0) { 355 $('.down-section-link').smoothScroll({ 356 speed: 900, 357 offset: -59 358 }); 359 } else { 360 $('.down-section-link').smoothScroll({ 361 speed: 900, 362 offset: 0 363 }); 364 } 365 366 $('.section-link').smoothScroll({ 367 speed: 900, 368 offset: 1 369 }); 370 371 /*============================================================== 372 portfolio filter 373 ==============================================================*/ 374 375 var hidedefault = true; 376 377 if ( $( '.portfolio-grid' ).length > 0 ) { 378 var $portfolio_filter = $('.portfolio-grid'); 379 $portfolio_filter.imagesLoaded(function () { 380 $portfolio_filter.isotope({ 381 layoutMode: 'masonry', 382 itemSelector: '.grid-item', 383 percentPosition: true, 384 masonry: { 385 columnWidth: '.grid-sizer' 386 } 387 }); 388 $portfolio_filter.isotope(); 389 }); 390 391 setTimeout( function() { 392 $portfolio_filter.imagesLoaded().progress( function() { 393 $portfolio_filter.isotope('layout'); 394 }); 395 }, 1000 ); 396 } 397 398 var arr_uniqueid = []; 399 var arr_dataid = [];
400 $('.portfolio-grid, .justified-gallery').each(function() { 401 arr_uniqueid.push($(this).attr('data-uniqueid')); 402 }); 403 404 var $grid_selectors = $('.portfolio-filter > li > a'); 405 406 $('.portfolio-filter > li.active > a').each(function( index ) { 407 var selector = $(this).attr('data-filter'); 408 if( selector != '*'){ 409 hidedefault = false; 410 if( $.inArray( $(this).attr( 'data-id' ), arr_dataid ) == -1 ){ 411 arr_dataid.push($(this).attr( 'data-id' )); 412 } 413 $(this).parent().parent().attr( 'data-infinite', 'false' ); 414 }else{ 415 hidedefault = true; 416 var idx = arr_dataid.indexOf($(this).attr( 'data-id' )); 417 if( idx >= 0 ){ 418 arr_dataid.splice(idx, 1); 419 } 420 $(this).parent().parent().attr( 'data-infinite', 'true' ); 421 } 422 default_selector(hidedefault); 423 }); 424 425 function default_selector(hidedefault){ 426 if( !hidedefault ) { 427 $('.portfolio-filter').each(function() { 428 if( $('#'+ $(this).attr( 'data-id' )+' > li.active > a').attr( 'data-id' ) != '' ){ 429 var portfolio_filter = $('.'+$(this).find('li.nav.active a').attr( 'data-id' )); 430 var data_id = $('#'+ $(this).find('li.nav.active a').attr( 'data-id' )).find('li.nav.active a').attr('data-filter'); 431 var portfolio_selector = data_id; 432 portfolio_filter.isotope({ 433 layoutMode: 'masonry', 434 itemSelector: '.grid-item', 435 percentPosition: true, 436 masonry: { 437 columnWidth: '.grid-sizer' 438 }, 439 filter: portfolio_selector 440 }); 441 } 442 }); 443 } 444 } 445 446 $grid_selectors.on('click', function () { 447 var selector = $(this).attr('data-filter'); 448 449 if( selector != '*'){ 450 if( $.inArray( $(this).attr( 'data-id' ), arr_dataid ) == -1 ){ 451 arr_dataid.push($(this).attr( 'data-id' )); 452 } 453 $(this).parent().parent().attr( 'data-infinite', 'false' ); 454 $( '.'+$(this).attr( 'data-id' ) ).infinitescroll('unbind'); 455 }else{ 456 var idx = arr_dataid.indexOf($(this).attr( 'data-id' )); 457 if( idx >= 0 ){ 458 arr_dataid.splice(idx, 1); 459 } 460 $(this).parent().parent().attr( 'data-infinite', 'true' ); 461 $(window).bind(".infscr"); 462 $( '.'+$(this).attr( 'data-id' ) ).infinitescroll('bind'); 463 } 464 $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting 465 $portfolio_filter.find('.grid-item').each(function () { 466 /* remove perticular element from WOW array when you don't want animation on element after DOM lead */ 467 wow.removeBox(this); 468 $(this).css("-webkit-animation", "none"); 469 $(this).css("-moz-animation", "none"); 470 $(this).css("-ms-animation", "none"); 471 $(this).css("animation", "none"); 472 }); 473 474 if( $(this).attr( 'data-id' ) != '' ){ 475 $grid_selectors = $('#'+ $(this).attr( 'data-id' )+' > li > a'); 476 $grid_selectors.parent().removeClass('active'); 477 $(this).parent().addClass('active'); 478 479 // Check justified gallery otherwise isotope portfolio 480 if ($('.'+$(this).attr( 'data-id' )).length > 0 && $('.'+$(this).attr( 'data-id' )).hasClass('justified-gallery') ) { 481 $('.'+$(this).attr( 'data-id' )).justifiedGallery({ filter: selector }); 482 } else { 483 $('.' + $(this).attr( 'data-id' )).isotope({filter: selector}); 484 } 485 486 }else{ 487 $grid_selectors.parent().removeClass('active'); 488 $(this).parent().addClass('active'); 489 $portfolio_filter.isotope({filter: selector}); 490 } 491 492 portfolio_infinite_arr(arr_dataid); 493 return false;
494 }); 495 496 portfolio_infinite_arr(arr_dataid); 497 498 function portfolio_infinite_arr(arr_dataid){ 499 $(arr_uniqueid).each(function(key,value){ 500 var hideinfinite = $('#'+value).attr('data-infinite'); 501 if( $.inArray( value, arr_dataid ) == -1 && ( hideinfinite || typeof(hideinfinite) == "undefined" ) ){ 502 portfolioinfinite(value); 503 $( '.'+value ).infinitescroll('bind'); 504 } 505 }); 506 } 507 // Portfolio Infinite Scroll 508 function portfolioinfinite(portfolio_val) { 509 var pagesNum = $("div.pofo-portfolio-infinite-scroll").attr('data-pagination'); 510 var selector = ''; 511 if( portfolio_val != '' && typeof( portfolio_val ) != 'undefined' ){ 512 selector = '.'+portfolio_val; 513 } else { 514 selector = '.portfolio-infinite-scroll-pagination'; 515 } 516 if( $(selector).length ) { 517 $(selector).infinitescroll({ 518 nextSelector: 'div.pofo-portfolio-infinite-scroll a', 519 loading: { 520 img: pofoMain.loading_image, 521 msgText: '<div class="paging-loader" style="transform:scale(0.35);"><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div></div>', 522 finishedMsg: '<div class="finish-load">' + pofoMain.message + '</div>', 523 speed: 'fast', 524 }, 525 navSelector: 'div.pofo-portfolio-infinite-scroll', 526 contentSelector: selector, 527 itemSelector: selector+' .portfolio-single-post', 528 maxPage: pagesNum, 529 }, function (newElements) { 530 531 $('#infscr-loading').remove(); 532 /* For new element set masonry */ 533 534 var $newportfoliopost = $(newElements); 535 $newportfoliopost.imagesLoaded( function() { 536 if ( !$(selector).hasClass('justified-gallery') ) { 537 $(selector).append( $newportfoliopost ).isotope( 'appended', $newportfoliopost ); 538 } 539 }); 540 541 if ($(selector).length > 0 && $(selector).hasClass('justified-gallery') ) { 542 $(selector).justifiedGallery({ 543 rowHeight: $(this).attr("data-height"), 544 maxRowHeight: false, 545 captions: true, 546 margins: $(this).attr("data-spacing"), 547 waitThumbnailsLoad: true 548 }); 549 } 550 551 equalizeHeight(); 552 }); 553 } 554 } 555 556 /*================================= 557 // Instagram Masonary 558 //=================================*/ 559 560 if ( $( '.pofo-instagram-masonary' ).length > 0 ) { 561 var $instagram_grid = $( '.pofo-instagram-masonary' ); 562 setTimeout( function() { 563 $instagram_grid.imagesLoaded(function () { 564 $instagram_grid.isotope({ 565 layoutMode: 'masonry', 566 itemSelector: '.grid-item', 567 masonry: { 568 columnWidth: '.grid-sizer' 569 } 570 }); 571 $instagram_grid.isotope(); 572 }); 573 },1000 ); 574 575 $(window).resize(function () { 576 setTimeout(function () { 577 $instagram_grid.imagesLoaded().progress( function() { 578 $instagram_grid.isotope('layout'); 579 }); 580 }, 300); 581 }); 582 } 583 584 /*================================= 585 //justified Gallery 586 =================================*/ 587 $(document).imagesLoaded(function () { 588 if ( $( '.justified-gallery-portfolio' ).length > 0 ) { 589 var data_height = $(".justified-gallery-portfolio").attr("data-height"); 590 var data_margin = $(".justified-gallery-portfolio").attr("data-spacing"); 591 if( ! data_height ){ 592 data_height = 400; 593 } 594 if( ! data_margin ){ 595 data_margin = 10; 596 } 597 $(".justified-gallery-portfolio").justifiedGallery({ 598 rowHeight: data_height, 599 maxRowHeight: false, 600 captions: true, 601 margins: data_margin, 602 waitThumbnailsLoad: true 603 }); 604 } 605 }); 606 607 $(window).resize(function () { 608 if (!isMobile && !isiPhoneiPad) { 609 setTimeout(function () { 610 $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting 611 $portfolio_filter.imagesLoaded().progress( function() { 612 $portfolio_filter.isotope('layout'); 613 }); 614 }, 300); 615 } 616 }); 617 618 var $blog_filter = $('.blog-grid'); 619 $blog_filter.imagesLoaded(function () { 620 $blog_filter.isotope({ 621 layoutMode: 'masonry', 622 itemSelector: '.grid-item', 623 percentPosition: true, 624 masonry: { 625 columnWidth: '.grid-sizer' 626 } 627 }); 628 }); 629 630 $(window).resize(function () { 631 setTimeout(function () { 632 $blog_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting 633 $blog_filter.imagesLoaded().progress( function() { 634 $blog_filter.isotope('layout'); 635 }); 636 }, 300); 637 }); 638 639 /*==============================================================*/ 640 // Slider Integrate into Tab - START CODE 641 /*==============================================================*/ 642 643 $('.nav-tabs a[data-toggle="tab"]').each(function () { 644 var $this = $(this); 645 $this.on('shown.bs.tab', function () { 646 if( $portfolio_filter.length > 0 ) { 647 $portfolio_filter.imagesLoaded( function () { 648 $portfolio_filter.isotope({ 649 layoutMode: 'masonry', 650 itemSelector: '.grid-item', 651 percentPosition: true, 652 masonry: { 653 columnWidth: '.grid-sizer' 654 } 655 }); 656 }); 657 } 658 if( $blog_filter.length > 0 ) { 659 $blog_filter.imagesLoaded(function () { 660 $blog_filter.isotope({ 661 layoutMode: 'masonry', 662 itemSelector: '.grid-item', 663 percentPosition: true, 664 masonry: { 665 columnWidth: '.grid-sizer' 666 } 667 }); 668 }); 669 } 670 }); 671 }); 672 673 /*==============================================================*/ 674 // Slider Integrate into Tab - END CODE 675 /*==============================================================*/ 676 677 /*============================================================== 678 lightbox gallery 679 ==============================================================*/ 680 681 $('.lightbox-gallery').magnificPopup({ 682 delegate: 'a', 683 type: 'image', 684 tLoading: 'Loading image #%curr%...', 685 mainClass: 'mfp-fade', 686 fixedContentPos: true, 687 closeBtnInside: false, 688 gallery: { 689 enabled: true, 690 navigateByImgClick: true, 691 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 692 }, 693 image: { 694 titleSrc: function (item) { 695 var title = ''; 696 var lightbox_caption = ''; 697 if( item.el.attr('title') ){ 698 title = item.el.attr('title'); 699 } 700 if( item.el.attr('data-lightbox-caption') ){ 701 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 702 } 703 return title + lightbox_caption; 704 } 705 } 706 }); 707 708 /* for group gallery */ 709 var lightboxgallerygroups = {}; 710 $('.lightbox-group-gallery-item').each(function () { 711 var id = $(this).attr('data-group'); 712 if (!lightboxgallerygroups[id]) { 713 lightboxgallerygroups[id] = []; 714 } 715 lightboxgallerygroups[id].push(this); 716 }); 717 $.each(lightboxgallerygroups, function () { 718 $(this).parents('.lightbox-gallery').magnificPopup({ 719 delegate: 'a', 720 type: 'image', 721 closeOnContentClick: true, 722 closeBtnInside: false, 723 fixedContentPos: true, 724 gallery: { enabled: true }, 725 image: { 726 titleSrc: function (item) { 727 var title = ''; 728 var lightbox_caption = ''; 729 if( item.el.attr('title') ){ 730 title = item.el.attr('title'); 731 } 732 if( item.el.attr('data-lightbox-caption') ){ 733 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 734 } 735 return title + lightbox_caption; 736 } 737 } 738 }); 739 }); 740 741 $('.lightbox-portfolio').magnificPopup({ 742 delegate: '.gallery-link', 743 type: 'image', 744 tLoading: 'Loading image #%curr%...', 745 mainClass: 'mfp-fade', 746 fixedContentPos: true, 747 closeBtnInside: false, 748 gallery: { 749 enabled: true, 750 navigateByImgClick: false, 751 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 752 }, 753 image: { 754 titleSrc: function (item) { 755 var title = ''; 756 var lightbox_caption = ''; 757 if( item.el.attr('title') ){ 758 title = item.el.attr('title'); 759 } 760 if( item.el.attr('data-lightbox-caption') ){ 761 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 762 } 763 return title + lightbox_caption; 764 } 765 } 766 }); 767 768 /* for group gallery */ 769 var lightboxgallery = {}; 770 $('.lightbox-portfolio').each(function () { 771 var id = $(this).attr('data-group'); 772 if (!lightboxgallery[id]) { 773 lightboxgallery[id] = []; 774 } 775 lightboxgallery[id].push(this); 776 }); 777 $.each(lightboxgallery, function () { 778 $(this).magnificPopup({ 779 delegate: '.gallery-link', 780 type: 'image', 781 tLoading: 'Loading image #%curr%...', 782 mainClass: 'mfp-fade', 783 fixedContentPos: true, 784 closeBtnInside: false, 785 gallery: { 786 enabled: true, 787 navigateByImgClick: false, 788 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 789 }, 790 image: { 791 titleSrc: function (item) { 792 var title = ''; 793 var lightbox_caption = ''; 794 if( item.el.attr('title') ){ 795 title = item.el.attr('title'); 796 } 797 if( item.el.attr('data-lightbox-caption') ){ 798 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 799 } 800 return title + lightbox_caption; 801 } 802 } 803 }); 804 }); 805 806 /*============================================================== 807 single image lightbox - zoom animation 808 ==============================================================*/ 809 $('.single-image-lightbox').magnificPopup({ 810 type: 'image', 811 closeOnContentClick: true, 812 fixedContentPos: true, 813 closeBtnInside: false, 814 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 815 image: { 816 verticalFit: true, 817 titleSrc: function (item) { 818 var title = ''; 819 var lightbox_caption = ''; 820 if( item.el.attr('title') ){ 821 title = item.el.attr('title'); 822 } 823 if( item.el.attr('data-lightbox-caption') ){ 824 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 825 } 826 return title + lightbox_caption; 827 } 828 }, 829 zoom: { 830 enabled: true, 831 duration: 300 // don't foget to change the duration also in CSS 832 } 833 }); 834 835 //fit videos 836 if( $(".fit-videos").length > 0 ) { 837 $(".fit-videos").fitVids(); 838 } 839 840 /*============================================================== 841 zoom gallery 842 ==============================================================*/ 843 844 /* for group gallery */ 845 var zoomgallerygroups = {}; 846 $('.zoom-gallery').each(function () { 847 var id = $(this).attr('data-group'); 848 if (!zoomgallerygroups[id]) { 849 zoomgallerygroups[id] = []; 850 } 851 zoomgallerygroups[id].push(this); 852 }); 853 $.each(zoomgallerygroups, function () { 854 $(this).magnificPopup({ 855 delegate: 'a', 856 type: 'image', 857 mainClass: 'mfp-with-zoom mfp-img-mobile', 858 fixedContentPos: true, 859 closeBtnInside: false, 860 image: { 861 verticalFit: true, 862 titleSrc: function (item) { 863 var title = ''; 864 var lightbox_caption = ''; 865 if( item.el.attr('title') ){ 866 title = item.el.attr('title'); 867 } 868 if( item.el.attr('data-lightbox-caption') ){ 869 lightbox_caption = '<span class="pofo-lightbox-caption">'+item.el.attr('data-lightbox-caption')+'</span>'; 870 } 871 return title + lightbox_caption; 872 } 873 }, 874 gallery: { 875 enabled: true 876 }, 877 zoom: { 878 enabled: true, 879 duration: 300, // don't foget to change the duration also in CSS 880 opener: function (element) { 881 return element.find('img'); 882 } 883 } 884 }); 885 }); 886 887 /*==============================================================*/ 888 //Modal popup - START CODE 889 /*==============================================================*/ 890 891 $('.modal-popup').magnificPopup({ 892 type: 'inline',
893 preloader: false, 894 // modal: true, 895 blackbg: true, 896 }); 897 898 $(document).on('click', '.popup-modal-dismiss', function (e) { 899 e.preventDefault(); 900 $.magnificPopup.close(); 901 }); 902 903 /*==============================================================*/ 904 //Modal popup - END CODE 905 /*==============================================================*/ 906 907 /*==============================================================*/ 908 //Modal popup - zoom animation - START CODE 909 /*==============================================================*/ 910 $('.popup-with-zoom-anim').magnificPopup({ 911 type: 'inline', 912 fixedBgPos: true, 913 overflowY: 'auto', 914 closeBtnInside: true, 915 preloader: false, 916 midClick: true, 917 removalDelay: 300, 918 blackbg: true, 919 mainClass: 'my-mfp-zoom-in' 920 }); 921 922 $('.popup-with-move-anim').magnificPopup({ 923 type: 'inline', 924 fixedBgPos: true, 925 overflowY: 'auto', 926 closeBtnInside: true, 927 preloader: false, 928 midClick: true, 929 removalDelay: 300, 930 blackbg: true, 931 mainClass: 'my-mfp-slide-bottom' 932 }); 933 /*==============================================================*/ 934 //Modal popup - zoom animation - END CODE 935 /*==============================================================*/ 936 937 /*============================================================== 938 popup with form 939 ==============================================================*/ 940 $('.popup-with-form').magnificPopup({ 941 type: 'inline', 942 preloader: false, 943 closeBtnInside: false, 944 fixedContentPos: true, 945 focus: '#name', 946 // When elemened is focused, some mobile browsers in some cases zoom in 947 // It looks not nice, so we disable it: 948 callbacks: { 949 beforeOpen: function () { 950 if ($(window).width() < 700) { 951 this.st.focus = false; 952 } else { 953 this.st.focus = '#name'; 954 } 955 } 956 } 957 }); 958 959 /*============================================================== 960 video magnific popup 961 ==============================================================*/ 962 $( '.popup-youtube, .popup-vimeo, .popup-googlemap' ).magnificPopup({ 963 disableOn: pofoMain.pofo_popup_video_disable, 964 type: 'iframe', 965 mainClass: 'mfp-fade', 966 removalDelay: 160, 967 preloader: false, 968 fixedContentPos: true, 969 closeBtnInside: false 970 }); 971 972 /*============================================================== 973 HTML5 Video magnific popup 974 ==============================================================*/ 975 if( $( '#html5-video-1' ).length > 0 ) { 976 977 $( '#html5-video-1' ).magnificPopup({ 978 type: 'inline', 979 fixedContentPos: true, 980 closeBtnInside: false 981 }); 982 } 983 984 /*============================================================== 985 ajax magnific popup for onepage portfolio 986 ==============================================================*/ 987 $('.ajax-popup').magnificPopup({ 988 type: 'ajax', 989 alignTop: true, 990 fixedContentPos: true, 991 overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump 992 callbacks: { 993 open: function () { 994 $('.navbar .collapse').removeClass('in'); 995 $('.navbar a.dropdown-toggle').addClass('collapsed'); 996 } 997 } 998 }); 999 1000 /*============================================================== 1001 wow animation - on scroll 1002 ==============================================================*/ 1003 var wow = new WOW({ 1004 boxClass: 'wow', 1005 animateClass: 'animated', 1006 offset: 0, 1007 mobile: pofoMain.mobileAnimation, 1008 live: true 1009 }); 1010 1011 $(window).imagesLoaded(function () { 1012 wow.init(); 1013 }); 1014 1015 /*============================================================== 1016 counter 1017 ==============================================================*/ 1018 1019 function animatecounters(element) { 1020 1021 var getCounterNumber = $(element).attr('data-to'); 1022 var getCounterSpeed = $(element).attr('data-speed'); 1023 var countersign = $(element).attr('data-postfix'); 1024 1025 getCounterSpeed = ( getCounterSpeed != '' && getCounterSpeed != undefined ) ? getCounterSpeed : 2000; 1026 1027 $({ ValuerHbcO: 0 }).delay(0).animate({ ValuerHbcO: getCounterNumber }, 1028 { 1029 duration: parseInt(getCounterSpeed), 1030 easing: "swing", 1031 step: function (currentLeft) {
1032 var roundNumber = Math.ceil( currentLeft ); 1033 if( countersign != '' && countersign != undefined ) { 1034 $(element).text( roundNumber + countersign ); 1035 } else { 1036 $(element).text( roundNumber ); 1037 } 1038 } 1039 }); 1040 } 1041 1042 /* =================================== 1043 counter number reset while scrolling 1044 ====================================== */ 1045 $('.timer').appear(); 1046 $(document.body).on('appear', '.timer', function (e) { 1047 // this code is executed for each appeared element 1048 var element = $(this); 1049 if (!$(this).hasClass('appear')) { 1050 animatecounters(element); 1051 $(this).addClass('appear'); 1052 } 1053 }); 1054 1055 $('.chart1').appear(); 1056 $(document.body).on('appear', '.chart1', function (e) { 1057 // this code is executed for each appeared element 1058 if (!$(this).hasClass('appear')) { 1059 $(this).addClass('appear'); 1060 $(this).data('easyPieChart').update(0).update($(this).data('percent')); 1061 } 1062 }); 1063 1064 $('.chart3').appear(); 1065 $(document.body).on('appear', '.chart3', function (e) { 1066 // this code is executed for each appeared element 1067 if (!$(this).hasClass('appear')) { 1068 $(this).addClass('appear'); 1069 $(this).data('easyPieChart').update(0).update($(this).data('percent')); 1070 } 1071 }); 1072 1073 if( $('#counter-coming-soon').length > 0 ) { 1074 $('#counter-coming-soon').countdown($('#counter-coming-soon').attr("data-enddate")).on('update.countdown', function (event) { 1075 var $this = $(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>')) 1076 }); 1077 } 1078 1079 /*==============================================================*/ 1080 // hamburger menu 1081 /*==============================================================*/ 1082 1083 $(document).on('click', '.btn-hamburger', function () { 1084 $('.hamburger-menu').toggleClass('show-menu'); 1085 $('body').removeClass('show-menu'); 1086 }); 1087 1088 //search form open close code 1089 $( document ).on( 'click', '.search-icon', function () { 1090 $(".search-block").addClass('open'); 1091 }); 1092 1093 $( document ).on( 'click', '.search-collapse', function () { 1094 $(".search-block").removeClass('open'); 1095 }); 1096 1097 /*==============================================================*/ 1098 //parralex text - START CODE 1099 /*==============================================================*/ 1100 1101 $('.swiper-auto-width .swiper-slide').mousemove(function (e) { 1102 var positionX = e.clientX; 1103 var positionY = e.clientY; 1104 positionX = Math.round(positionX / 10) - 80; 1105 positionY = Math.round(positionY / 10) - 40; 1106 $(this).find('.parallax-text').css({'transform': 'translate(' + positionX + 'px,' + positionY + 'px)', 'transition-duration': '0s'}); 1107 }); 1108 1109 $('.swiper-auto-width .swiper-slide').mouseout(function (e) { 1110 $('.parallax-text').css({'transform': 'translate(0,0)', 'transition-duration': '0.5s'}); 1111 }); 1112 1113 /*==============================================================*/ 1114 //parralex text - END CODE 1115 /*==============================================================*/ 1116 1117 $( document ).on( 'click', '.atr-nav', function () { 1118 $(".atr-div").append("<a class='close-cross' href='#'>X</a>"); 1119 $(".atr-div").animate({ 1120 width: "toggle" 1121 }); 1122 }); 1123 $( document ).on( 'click', '.close-cross', function () { 1124 $(".atr-div").hide(); 1125 }); 1126 1127 var menuRight = document.getElementById('cbp-spmenu-s2'), 1128 showRightPush = document.getElementById('showRightPush'); 1129 1130 if( menuRight && showRightPush ) { 1131 showRightPush.onclick = function () { 1132 classie.toggle(this, 'active'); 1133 classie.toggle(menuRight, 'cbp-spmenu-open'); 1134 }; 1135 } 1136 1137 /* For Header Type 4 */ 1138 var headerShowRightPush = document.getElementById('headerShowRightPush'); 1139 1140 if( headerShowRightPush ) { 1141 headerShowRightPush.onclick = function () { 1142 classie.toggle(this, 'active'); 1143 return false;
1144 }; 1145 } 1146 1147 var closePushMenu = document.getElementById('close-pushmenu'); 1148 if (closePushMenu) { 1149 closePushMenu.onclick = function () { 1150 classie.toggle(this, 'active'); 1151 classie.toggle(menuRight, 'cbp-spmenu-open'); 1152 return false; 1153 }; 1154 } 1155 1156 $(document).on('click', '.navbar-collapse [data-toggle="dropdown"]', function (event) { 1157 1158 var $innerLinkLI = $(this).parents('ul.navbar-nav').find('li.dropdown a.inner-link').parent('li.dropdown'); 1159 if (!$(this).hasClass('inner-link') && !$(this).hasClass('dropdown-toggle') && $innerLinkLI.hasClass('open')) { 1160 $innerLinkLI.removeClass('open'); 1161 } 1162 var target = $(this).attr('target'); 1163 if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').indexOf("#") <= -1 && !$(event.target).is('i')) { 1164 if (event.ctrlKey || event.metaKey) { 1165 window.open($(this).attr('href'), "_blank"); 1166 return false; 1167 } else if (!target) 1168 window.location = $(this).attr('href'); 1169 else 1170 window.open($(this).attr('href'), target); 1171 1172 } else if ($(window).width() > 991 && $(this).attr('href') && $(this).attr('href').indexOf("#") <= -1) { 1173 if (event.ctrlKey || event.metaKey) { 1174 window.open($(this).attr('href'), "_blank"); 1175 return false; 1176 } else if (!target) 1177 window.location = $(this).attr('href'); 1178 else 1179 window.open($(this).attr('href'), target); 1180 1181 } else if ($(window).width() <= 991 && $(this).attr('href') && $(this).attr('href').length > 1 && $(this).attr('href').indexOf("#") >= 0 && $(this).hasClass('inner-link')) { 1182 $(this).parents('ul.navbar-nav').find('li.dropdown').not($(this).parent('.dropdown')).removeClass('open'); 1183 if ($(this).parent('.dropdown').hasClass('open')) { 1184 $(this).parent('.dropdown').removeClass('open'); 1185 } else { 1186 $(this).parent('.dropdown').addClass('open'); 1187 } 1188 $(this).toggleClass('active'); 1189 } 1190 }); 1191 1192 /* =================================== 1193 skillbar 1194 ====================================== */ 1195 $('.skillbar').appear(); 1196 $('.skillbar').skillBars({ 1197 from: 0, 1198 speed: 4000, 1199 interval: 100, 1200 decimals: 0 1201 }); 1202 1203 $(document.body).on('appear', '.skillbar', function (e) { 1204 // this code is executed for each appeared element 1205 if (!$(this).hasClass('skillbar-appear')) { 1206 $(this).addClass('skillbar-appear'); 1207 $(this).find('.skillbar-bar').css("width", "0%"); 1208 $(this).skillBars({ 1209 from: 0, 1210 speed: 4000, 1211 interval: 100, 1212 decimals: 0 1213 }); 1214 } 1215 }); 1216 1217 /* =================================== 1218 touchstart click 1219 ====================================== */ 1220 1221 $( document ).on('touchstart click', 'body', function (e) { 1222 if ($(window).width() < 992) { 1223 if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse').hasClass('in') && !$(e.target).hasClass('navbar-toggle')) { 1224 $('.navbar-collapse').collapse('hide'); 1225 } 1226 } else { 1227 if (!$('.navbar-collapse').has(e.target).is('.navbar-collapse') && $('.navbar-collapse ul').hasClass('in')) { 1228 $('.navbar-collapse').find('a.dropdown-toggle').addClass('collapsed'); 1229 $('.navbar-collapse').find('ul.dropdown-menu').removeClass('in'); 1230 $('.navbar-collapse a.dropdown-toggle').removeClass('active'); 1231 } 1232 } 1233 }); 1234 1235 /* =================================== 1236 blog hover box 1237 ====================================== */ 1238 1239 $(".blog-post-style4 .grid-item").hover(function () { 1240 $(this).find("figcaption .blog-hover-text").slideDown(300); 1241 }, function () { 1242 $(this).find("figcaption .blog-hover-text").slideUp(300); 1243 }); 1244 1245 /*==============================================================*/ 1246 //Set Resize Header Menu - START CODE 1247 /*==============================================================*/ 1248 1249 $( document ).on( 'click', 'nav.full-width-pull-menu ul.panel-group li.dropdown a.dropdown-toggle', function () { 1250 if ($(this).parent('li').find('ul.dropdown-menu').length > 0) { 1251 if ($(this).parent('li').hasClass('open')) { 1252 $(this).parent('li').removeClass('open'); 1253 } 1254 else { 1255 $(this).parent('li').addClass('open'); 1256 } 1257 } 1258 }); 1259 1260 /*==============================================================*/ 1261 //accordion - START CODE 1262 /*==============================================================*/ 1263 1264 $( document ).on( 'click', '.nav.navbar-nav a.inner-link', function (e) { 1265 $(this).parents('ul.navbar-nav').find('a.inner-link').removeClass('active'); 1266 $(this).addClass('active'); 1267 //if ($('.navbar-header .navbar-toggle').is(':visible')) { 1268 $(this).parents('.navbar-collapse').collapse('hide'); 1269 //} 1270 }); 1271 1272 $('.accordion-style1 .collapse').on('show.bs.collapse', function () { 1273 var id = $(this).attr('id'); 1274 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 1275 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>'); 1276 }); 1277 1278 $('.accordion-style1 .collapse').on('hide.bs.collapse', function () { 1279 var id = $(this).attr('id'); 1280 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 1281 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>'); 1282 }); 1283 1284 $('.accordion-style2 .collapse').on('show.bs.collapse', function () { 1285 var id = $(this).attr('id'); 1286 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 1287 $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); 1288 }); 1289 1290 $('.accordion-style2 .collapse').on('hide.bs.collapse', function () { 1291 var id = $(this).attr('id'); 1292 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 1293 $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); 1294 }); 1295 1296 $('.accordion-style3 .collapse').on('show.bs.collapse', function () { 1297 var id = $(this).attr('id'); 1298 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 1299 $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); 1300 }); 1301 1302 $('.accordion-style3 .collapse').on('hide.bs.collapse', function () { 1303 var id = $(this).attr('id'); 1304 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 1305 $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); 1306 }); 1307 1308 /*==============================================================*/ 1309 //accordion - END CODE 1310 /*==============================================================*/ 1311 1312 /*==============================================================*/ 1313 //toggles - START CODE 1314 /*==============================================================*/ 1315 1316 $('.toggles .collapse').on('show.bs.collapse', function () { 1317 var id = $(this).attr('id'); 1318 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 1319 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-minus"></i>'); 1320 }); 1321 1322 $('.toggles .collapse').on('hide.bs.collapse', function () { 1323 var id = $(this).attr('id'); 1324 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 1325 $('a[href="#' + id + '"] .panel-title span').html('<i class="ti-plus"></i>'); 1326 }); 1327 1328 $('.toggles-style2 .collapse').on('show.bs.collapse', function () { 1329 var id = $(this).attr('id'); 1330 $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); 1331 $('a[href="#' + id + '"] .panel-title span').html('<i class="fa-solid fa-angle-up"></i>'); 1332 }); 1333 1334 $('.toggles-style2 .collapse').on('hide.bs.collapse', function () { 1335 var id = $(this).attr('id'); 1336 $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); 1337 $('a[href="#' + id + '"] .panel-title span').html('<i class="fa-solid fa-angle-down"></i>'); 1338 }); 1339 1340 /*==============================================================*/ 1341 //toggles - END CODE 1342 /*==============================================================*/ 1343 1344 /*==============================================================*/ 1345 // Header Search Magnific Popup - START CODE 1346 /*==============================================================*/ 1347 1348 $('.header-search-form').magnificPopup({ 1349 mainClass: 'mfp-fade pofo-search-popup', 1350 closeOnBgClick: true, 1351 preloader: false, 1352 // for white backgriund
1353 fixedContentPos: false, 1354 closeBtnInside: false, 1355 callbacks: { 1356 open: function () { 1357 setTimeout(function () { 1358 $('.search-input').focus(); 1359 }, 500); 1360 $('#search-header').parent().addClass('search-popup'); 1361 if (!isMobile) { 1362 $('body').addClass('overflow-hidden'); 1363 //$('body').addClass('position-fixed'); 1364 $('body').addClass('width-100'); 1365 document.onmousewheel = ScrollStop; 1366 } else { 1367 $('body, html').on('touchmove', function (e) { 1368 e.preventDefault(); 1369 }); 1370 } 1371 }, 1372 close: function () { 1373 if (!isMobile) { 1374 $('body').removeClass('overflow-hidden'); 1375 //$('body').removeClass('position-fixed'); 1376 $('body').removeClass('width-100'); 1377 $('#search-header input[type=text]').each(function (index) { 1378 if (index == 0) { 1379 $(this).val(''); 1380 $("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid rgba(255,255,255,0.5)" }); 1381 } 1382 }); 1383 document.onmousewheel = ScrollStart; 1384 } else { 1385 $('body, html').unbind('touchmove'); 1386 } 1387 } 1388 } 1389 }); 1390 1391 // Click event to review to scroll 1392 if($('.woocommerce-review-link').length > 0) { 1393 $('.woocommerce-review-link').on('click', function () { 1394 $( "#tab-title-reviews a" ).trigger( "click" ); 1395 $('html, body').animate({ 1396 scrollTop: $(".woocommerce-tabs").offset().top 1397 }, 800); 1398 return false; 1399 }); 1400 } 1401 1402 }); //end ready 1403 1404 $( 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) { 1405 e.preventDefault(); 1406 }); 1407 1408 var lastScroll = 0; 1409 $(window).on("scroll", init_scroll_navigate); 1410 function init_scroll_navigate() { 1411 1412 /*============================================================== 1413 One Page Main JS - START CODE 1414 =============================================================*/ 1415 1416 var menu_links = $(".navbar-nav li a"); 1417 var scrollPos = $(document).scrollTop(); 1418 scrollPos = scrollPos + 60; 1419 menu_links.each(function () { 1420 var currLink = $(this); 1421 if( currLink.attr("href") != '' && currLink.attr("href") != undefined ) { 1422 var hasPos = currLink.attr("href").indexOf("#"); 1423 if( hasPos > -1 ) { 1424 var res = currLink.attr("href").substring( hasPos ); 1425 var hashID = res.replace( '#', '' ); 1426 var elementExists = document.getElementById( hashID ); 1427 if ( res != '' && res != '#' && elementExists != '' && elementExists != null ) { 1428 var refElement = $( res ); 1429 if (refElement.offset().top <= scrollPos && refElement.offset().top + refElement.height() > scrollPos) { 1430 menu_links.not( currLink ).removeClass("active"); 1431 currLink.addClass("active"); 1432 } else { 1433 currLink.removeClass("active"); 1434 } 1435 } 1436 } 1437 } 1438 }); 1439 1440 /*============================================================== 1441 One Page Main JS - END CODE 1442 =============================================================*/ 1443 1444 /*============================================================== 1445 background color slider Start 1446 ==============================================================*/ 1447 1448 // selectors 1449 var $window = $(window), 1450 $body = $('body'), 1451 $panel = $('.color-code'); 1452 var scroll = $window.scrollTop() + ($window.height() / 2); 1453 $panel.each(function () { 1454 var $this = $(this); 1455 if ($this.position().top <= scroll && $this.position().top + $this.height() > scroll) { 1456 $body.css('background-color', $(this).data('color')); 1457 } 1458 }); 1459 1460 /*============================================================== 1461 background color slider End 1462 ==============================================================*/ 1463 1464 /* =================================== 1465 sticky nav Start 1466 ====================================== */ 1467 1468 if( $( '.left-nav .sidebar-part1' ).length > 0 ) { 1469 var topHeaderHeight = $('.top-header-area' ).outerHeight(); 1470 var headerHeight = $('.left-nav .sidebar-part1').outerHeight(); 1471 var headerHeight = headerHeight + topHeaderHeight; 1472 } else if( $( '.sidenav-header' ).length > 0 ) { 1473 var topHeaderHeight = $('.top-header-area' ).outerHeight(); 1474 var headerHeight = $('.sidenav-header').outerHeight(); 1475 var headerHeight = headerHeight + topHeaderHeight; 1476 } else { 1477 var headerHeight = $('nav').outerHeight(); 1478 } 1479 if (!$('header').hasClass('no-sticky')) { 1480 if ($(document).scrollTop() >= headerHeight) { 1481 $('header').addClass('sticky'); 1482 } else if ($(document).scrollTop() <= headerHeight) { 1483 $('header').removeClass('sticky'); 1484 } 1485 SetMegamenuPosition(); 1486 } else if( $( 'header' ).hasClass( 'sticky-mini-header' ) ) { 1487 if ($(document).scrollTop() >= headerHeight) { 1488 $('header').addClass('min-header-appear'); 1489 } else if ($(document).scrollTop() <= headerHeight) { 1490 $('header').removeClass('min-header-appear'); 1491 } 1492 } 1493 1494 /* =================================== 1495 header appear on scroll up 1496 ====================================== */ 1497 1498 var st = $(this).scrollTop(); 1499 if (st > lastScroll) { 1500 $('header.sticky').removeClass('header-appear'); 1501 } else { 1502 $('header.sticky').addClass('header-appear'); 1503 } 1504 lastScroll = st; 1505 if (lastScroll == 0) { 1506 $('header.header-main-wrapper').removeClass('header-appear'); 1507 } 1508 1509 CenterLogoHeight(); 1510 1511 /* =================================== 1512 sticky nav End 1513 ====================================== */ 1514 1515 if( $(window).width() <= pofoMain.menu_breakpoint ) { 1516 $('nav.pofo-standard-menu').addClass( 'mobile-menu' ); 1517 } else { 1518 $('nav.pofo-standard-menu').removeClass( 'mobile-menu' ); 1519 } 1520 } 1521 1522 function ScrollStop() { 1523 return false;
1524 } 1525 function ScrollStart() { 1526 return true; 1527 } 1528 1529 function feature_dynamic_font_line_height() { 1530 1531 if($('.dynamic-font-size').length > 0) { 1532 var site_width = 1170; 1533 var window_width = $(window).width(); 1534 1535 if(window_width < site_width) { 1536 var window_site_width_ratio = window_width / site_width; 1537 } 1538 1539 $('.dynamic-font-size').each(function ( index ) { 1540 var font_size = $(this).attr('data-fontsize'); 1541 var line_height = $(this).attr('data-lineheight'); 1542 1543 if(font_size != '' && font_size != undefined) { 1544 font_size = font_size.replace("px", ""); 1545 if(window_width < site_width) { 1546 font_size = Math.round(font_size * window_site_width_ratio * 1000) / 1000; 1547 } 1548 $(this).css('font-size', font_size + 'px'); 1549 } 1550 if(line_height != '' && line_height != undefined) { 1551 line_height = line_height.replace("px", ""); 1552 if(window_width < site_width) { 1553 line_height = Math.round(line_height * window_site_width_ratio * 1000) / 1000; 1554 } 1555 $(this).css('line-height', line_height + 'px'); 1556 } 1557 }); 1558 } 1559 } 1560 1561 /*============================================================== 1562 center logo container height 1563 ==============================================================*/ 1564 1565 function CenterLogoHeight(){ 1566 if( $(".navbar").hasClass("header-center-logo") ){ 1567 var centerLogoHeight = $(".pofo-header-logo.center-logo").outerHeight(); 1568 var menuHeight = $(".accordion-menu").outerHeight(); 1569 if( centerLogoHeight || menuHeight ){ 1570 var navContainerHeight = ( menuHeight > centerLogoHeight ) ? menuHeight : centerLogoHeight; 1571 $(".navbar").find(".nav-header-container").css('cssText', 'height: ' + navContainerHeight + 'px;'); 1572 } 1573 } 1574 } 1575 1576 /*============================================================== 1577 equalize 1578 ==============================================================*/ 1579 1580 function equalizeHeight() { 1581 if( $('.equalize').length > 0 ) { 1582 1583 $('.equalize').equalize({equalize: 'outerHeight', reset: true}); 1584 1585 if( $('.inner-match-height').length > 0 ) { 1586 $('.equalize').equalize({equalize: 'outerHeight', children: '.inner-match-height', reset: true}); 1587 } 1588 } 1589 } 1590 1591 /*============================================================== 1592 Resize Content 1593 ==============================================================*/ 1594 1595 function SetResizeContent() { 1596 1597 var element = $(".full-screen"); 1598 element.parents('section').imagesLoaded(function () { 1599 var minheight = $(window).height(); 1600 element.children( '.vc_column-inner' ).css('min-height', minheight); 1601 element.css('min-height', minheight); 1602 }); 1603 1604 var minwidth = $(window).width(); 1605 var winheight = $(window).height(); 1606 $(".full-screen-width").css('min-width', minwidth); 1607 1608 var sidebarNavHeight = $('.sidebar-nav-style-1').height() - $('.logo-holder').parent().height() - $('.footer-holder').parent().height() - 10; 1609 $(".sidebar-nav-style-1 .nav").css('height', (sidebarNavHeight)); 1610 1611 var style2NavHeight = parseInt($('.sidebar-part2').height() - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-top')) - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-bottom')) - parseInt($(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('margin-bottom'))); 1612 $(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('height', (style2NavHeight)); 1613 1614 if( $(window).width() <= pofoMain.menu_breakpoint ) { 1615 $('.left-nav').addClass( 'mobile-left-menu' ); 1616 $('.sidebar-nav-style-1').addClass( 'mobile-left-menu' ); 1617 1618 // Left menu classic 1619 if( $('.sidebar-wrapper').length > 0 ) { 1620 var left_menu_width = $( 'nav.sidebar-nav' ).width(); 1621 $( '.sidebar-wrapper div.container section.pofo-stretch-content').each(function () { 1622 if( !$( this ).hasClass( 'pofo-stretch-row-container' ) ) { 1623 this.style.setProperty( 'padding-left', 'inherit', 'important' ); 1624 } 1625 }); 1626 } 1627 // Left menu modern 1628 if( $('.left-nav-sidebar .sidebar-part3').length > 0 ) { 1629 var left_menu_width = $( '.left-nav-sidebar .sidebar-part3' ).width(); 1630 $( '.left-nav-sidebar div.container .entry-content section.pofo-stretch-content').each(function () { 1631 if( !$( this ).hasClass( 'pofo-stretch-row-container' ) ) { 1632 this.style.setProperty( 'padding-left', 'inherit', 'important' ); 1633 } 1634 }); 1635 } 1636 1637 } else { 1638 $('.left-nav').removeClass( 'mobile-left-menu' ); 1639 $('.sidebar-nav-style-1').removeClass( 'mobile-left-menu' ); 1640 1641 // Left menu classic 1642 if( $('.sidebar-wrapper').length > 0 ) { 1643 var left_menu_width = $( 'nav.sidebar-nav' ).width(); 1644 $( '.sidebar-wrapper div.container section.pofo-stretch-content').each(function () { 1645 if( !$( this ).hasClass( 'pofo-stretch-row-container' ) ) { 1646 this.style.setProperty( 'padding-left', left_menu_width + 'px', 'important' ); 1647 } 1648 }); 1649 } 1650 // Left menu modern 1651 if( $('.left-nav-sidebar .sidebar-part3').length > 0 ) { 1652 var left_menu_width = $( '.left-nav-sidebar .sidebar-part3' ).width(); 1653 $( '.left-nav-sidebar div.container .entry-content section.pofo-stretch-content').each(function () { 1654 if( !$( this ).hasClass( 'pofo-stretch-row-container' ) ) { 1655 this.style.setProperty( 'padding-left', left_menu_width + 'px', 'important' ); 1656 } 1657 }); 1658 } 1659 } 1660 1661 equalizeHeight(); 1662 setPageTitleSpace(); 1663 setMobileHeight(); 1664 } 1665 1666 /*============================================================== 1667 set parallax 1668 ==============================================================*/ 1669 function pofoParallax() { 1670 if( ! isIE() ) { 1671 $( '[data-parallax-background-ratio]' ).each( function() {
1672 var ratio = $( this ).attr( 'data-parallax-background-ratio' ) || 0.5; 1673 $( this ).parallax( '50%', ratio ); 1674 }); 1675 } 1676 } 1677 1678 //swiper button position in auto height slider 1679 function setButtonPosition() { 1680 1681 if( $(window).width() > 767 && $(".swiper-auto-height-container").length > 0 ) { 1682 1683 setTimeout(function () { 1684 1685 var leftPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-left')); 1686 var bottomPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-bottom')); 1687 var bannerWidth = parseInt($('.swiper-auto-height-container .slide-banner').outerWidth()); 1688 $('.navigation-area').css({'left': bannerWidth + leftPosition + 'px', 'bottom': bottomPosition + 'px'}); 1689 }, 300); 1690 } 1691 } 1692 1693 $(window).resize(function (event) { 1694 1695 destroySwiperLoop(); 1696 feature_dynamic_font_line_height(); 1697 setButtonPosition(); 1698 init_scroll_navigate(); 1699 CenterLogoHeight(); 1700 resetSwiperLoop(); 1701 1702 // Bootsnav menu work with eualize height 1703 $("nav.navbar.bootsnav ul.nav").each(function () { 1704 $("li.dropdown", this).on("mouseenter", function () { 1705 equalizeHeight(); 1706 return false; 1707 }); 1708 }); 1709 1710 // Bootsnav tab work with eualize height 1711 $('a[data-toggle="tab"]').on('shown.bs.tab', function () { 1712 equalizeHeight(); 1713 return false; 1714 }); 1715 1716 setTimeout(function () { 1717 SetResizeContent(); 1718 pofoParallax(); 1719 }, 500); 1720 event.preventDefault(); 1721 1722 }); 1723 1724 /*==============================================================*/ 1725 // Comment Validation - START CODE 1726 /*==============================================================*/ 1727 1728 $(".pofo-comment-button").on("click", function () { 1729 var fields; 1730 fields = ""; 1731 if ($(this).parent().parent().find('#author').length == 1) { 1732 if ($(".comment-form").find("#author").val().length == 0 || $(".comment-form").find("#author").val().value == '') { 1733 fields = '1'; 1734 $(".comment-form").find("#author").addClass("inputerror"); 1735 } 1736 } 1737 if ($(this).parent().parent().find('#comment').length == 1) { 1738 if ($(".comment-form").find("#comment").val().length == 0 || $(".comment-form").find("#comment").val().value == '') { 1739 fields = '1'; 1740 $(".comment-form").find("#comment").addClass("inputerror"); 1741 } 1742 } 1743 if ($(this).parent().parent().find('#email').length == 1) { 1744 if ($(".comment-form").find("#email").val().length == 0 || $(".comment-form").find("#email").val().length == '') { 1745 fields = '1'; 1746 $(".comment-form").find("#email").addClass("inputerror"); 1747 } else { 1748 var re = new RegExp(); 1749 re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; 1750 var sinput; 1751 sinput = ""; 1752 sinput = $(".comment-form").find("#email").val(); 1753 if (!re.test(sinput)) { 1754 fields = '1'; 1755 $(".comment-form").find("#email").addClass("inputerror"); 1756 } 1757 } 1758 } 1759 if (fields != "") { 1760 return false; 1761 } else { 1762 return true; 1763 } 1764 }); 1765 1766 /*==============================================================*/ 1767 // Comment Validation - END CODE 1768 /*==============================================================*/ 1769 1770 $('.comment-fields').on('focus', function () { 1771 $(this).removeClass('inputerror'); 1772 }); 1773 1774 /*==============================================================*/ 1775 // Infinite Scroll jQuery - START CODE 1776 /*==============================================================*/ 1777 1778 // Blog Infinite Scroll 1779 if( $('.infinite-scroll-pagination').length ) { 1780 var pagesNum = $("div.pofo-infinite-scroll").attr('data-pagination'); 1781 $('.infinite-scroll-pagination').infinitescroll({ 1782 nextSelector: 'div.pofo-infinite-scroll a', 1783 loading: { 1784 img: pofoMain.loading_image, 1785 msgText: '<div class="paging-loader" style="transform:scale(0.35);"><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div><div class="circle"><div></div></div></div>', 1786 finishedMsg: '<div class="finish-load">' + pofoMain.message + '</div>', 1787 speed: 'fast', 1788 }, 1789 navSelector: 'div.pofo-infinite-scroll', 1790 contentSelector: '.infinite-scroll-pagination', 1791 itemSelector: '.infinite-scroll-pagination .blog-single-post', 1792 maxPage: pagesNum, 1793 }, function (newElements) { 1794 1795 $('#infscr-loading').remove(); 1796 /* For new element set masonry */ 1797 var $newblogpost = $(newElements); 1798 $newblogpost.imagesLoaded( function() { 1799 $('.blog-grid').append( $newblogpost ) 1800 .isotope( 'appended', $newblogpost ); 1801 }); 1802 equalizeHeight(); 1803 feature_dynamic_font_line_height(); 1804 }); 1805 } 1806 1807 /*==============================================================*/ 1808 // Infinite Scroll jQuery - END CODE 1809 /*==============================================================*/ 1810 1811 /*==============================================================*/ 1812 // Post Like Dislike Button JQuery - START CODE 1813 /*==============================================================*/ 1814 $(document).on('click', '.sl-button', function() { 1815 var button = $(this); 1816 var post_id = button.attr('data-post-id'); 1817 var security = button.attr('data-nonce'); 1818 var iscomment = button.attr('data-iscomment'); 1819 var allbuttons; 1820 if ( iscomment === '1' ) { /* Comments can have same id */ 1821 allbuttons = $('.sl-comment-button-'+post_id); 1822 } else { 1823 allbuttons = $('.sl-button-'+post_id); 1824 } 1825 var loader = allbuttons.next('#sl-loader'); 1826 if (post_id !== '') { 1827 $.ajax({ 1828 type: 'POST', 1829 url: simpleLikes.ajaxurl, 1830 data : { 1831 action : 'process_simple_like', 1832 post_id : post_id, 1833 nonce : security, 1834 is_comment : iscomment 1835 }, 1836 beforeSend:function(){ 1837 }, 1838 success: function(response){ 1839 var icon = response.icon; 1840 var count = response.count; 1841 allbuttons.html(icon+count); 1842 if(response.status === 'unliked') { 1843 var like_text = simpleLikes.like; 1844 allbuttons.prop('title', like_text); 1845 allbuttons.removeClass('liked'); 1846 } else { 1847 var unlike_text = simpleLikes.unlike; 1848 allbuttons.prop('title', unlike_text); 1849 allbuttons.addClass('liked'); 1850 } 1851 loader.empty(); 1852 } 1853 }); 1854 1855 } 1856 return false;
1857 }); 1858 /*==============================================================*/ 1859 // Post Like Dislike Button JQuery - END CODE 1860 /*==============================================================*/ 1861 1862 /****** Setup swiper slider ******/ 1863 function setupSwiper() { 1864 1865 /****** Swiper slider using params ******/ 1866 $( '[data-slider-options]' ).each( function () { 1867 var _this = $( this ), 1868 sliderOptions = _this.attr( 'data-slider-options' ); 1869 if ( typeof ( sliderOptions ) !== 'undefined' && sliderOptions !== null ) { 1870 1871 sliderOptions = $.parseJSON( sliderOptions ); 1872 1873 /* If user have provided "data-number-pagination" attribute then below code will execute */ 1874 var numberPagination = _this.attr( 'data-number-pagination' ); 1875 if( numberPagination != '' && numberPagination != undefined && numberPagination == '1' && sliderOptions['pagination'] != '' && sliderOptions['pagination'] != undefined ) { 1876 sliderOptions['pagination']['type'] = 'custom'; 1877 sliderOptions['pagination']['renderCustom'] = function ( swiper, current, total ) { 1878 var customHTML = ''; 1879 for ( var i = 1; i <= total; i++ ) { 1880 var pageNumber = i; 1881 var activeClass = i == current ? ' swiper-pagination-bullet-active' : ''; 1882 pageNumber = ( pageNumber < 10 ) ? '0' + pageNumber.toString() : pageNumber.toString(); 1883 customHTML += '<span class=\"swiper-pagination-bullet' + activeClass + '\" tabindex=\"0\" role=\"button\" aria-label=\"Go to slide ' + i + '\">' + pageNumber + '</span>'; 1884 } 1885 return customHTML; 1886 } 1887 } 1888 1889 _this.imagesLoaded( function () { 1890 equalizeHeight(); 1891 var swiperObj = new Swiper( _this, sliderOptions ); 1892 swiperObjs.push( swiperObj ); 1893 }); 1894 } 1895 }); 1896 resetSwiperLoop(); 1897 } 1898 1899 /****** Destroy swiper loop ******/ 1900 function destroySwiperLoop() { 1901 setTimeout( function() { 1902 for( var i=0; i < swiperObjs.length; i++ ) { 1903 var swiperObj = swiperObjs[i], 1904 destroyWidth= swiperObj.$el.attr( 'data-slider-destroy' ); 1905 // If user have provided "data-slider-destroy" attribute then below code will execute 1906 if( destroyWidth != '' && destroyWidth != undefined ) { 1907 if ( $( window ).width() <= destroyWidth ) { 1908 swiperObj.destroy( false, true ); // Destroy swiper 1909 } else if( swiperObj.destroyed ) { 1910 swiperObjs.splice(i, 1); 1911 setupSwiper(); // Initialize swiper again 1912 } 1913 } 1914 }; 1915 }, 200 ); 1916 } 1917 1918 /****** Reset swiper loop ******/ 1919 function resetSwiperLoop() { 1920 for( var i=0; i < swiperObjs.length; i++ ) { 1921 var swiperObj = swiperObjs[i]; 1922 1923 equalizeHeight(); 1924 swiperObj.update(); 1925 } 1926 } 1927 1928})( 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.