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