1 2// ================================================================================== // 3 4 // # Document on Ready 5 // # Document on Resize 6 // # Document on Scroll 7 // # Document on Load 8 9 // # Sticky Header 10 // # Leader Post Size 11 // # Header 12 // # Post Sticky Items 13 // # Sticky Sidebar Widget 14 // # Sticky Sidebar 15 // # Feature Section 16 // # Feature Parallax 17 // # Page Title 18 // # Page Settings 19 // # Basic Elements 20 // # Isotope 21 // # Parallax Section 22 // # Section Settings 23 // # Social Bar For Post 24 // # Scroll Direction 25 // # Global Variables 26 // # Scrollbar Width 27 // # Full Page 28 29 // # Sticky Section 30 31// ================================================================================== // 32 33 34var EUTHEM = EUTHEM || {}; 35var debugJs = false; 36var spinner = '<div class="eut-spinner"></div>'; 37var addFeatureSpinner = false; 38var hiddenMenuItemsAnimation = true; 39var hiddenaAreaMinWidth = 550; 40var gridEqual = true; 41var wooThumbCarouselItems = 4; 42var featureSliderHandler = true; 43 44// Animate Mask Options 45var maskLayers = 3; 46var maskColorClasses = ['eut-bg-primary-1','eut-bg-light','eut-bg-dark']; 47 48var deviceAnimAppear = false; 49if( 1 == fildisi_eutf_main_data.device_animations ) { 50 deviceAnimAppear = true; 51} 52 53(function($){ 54 55 "use strict"; 56 57 58 // # Document on Ready 59 // ============================================================================= // 60 EUTHEM.documentReady = { 61 init: function(){ 62 EUTHEM.pageSettings.bodyLoader(); 63 EUTHEM.svgAnimation.init(); 64 EUTHEM.advancedHiddenMenu.init(); 65 EUTHEM.pageSettings.removeVideoBg(); 66 EUTHEM.pageSettings.addVideoBg(); 67 EUTHEM.sectionSettings.init(); 68 EUTHEM.slideToggleMenu.init( '#eut-hidden-menu', '#eut-hidden-menu .eut-menu' ); 69 EUTHEM.slideToggleMenu.init( '#eut-main-header.eut-header-side', '#eut-main-menu.eut-vertical-menu .eut-menu' ); 70 EUTHEM.slideToggleMenu.init( '#eut-sidearea', '.widget_nav_menu' ); 71 if( $('#eut-feature-section').length > 0 ){ 72 EUTHEM.featureSection.init( '#eut-feature-section' ); 73 EUTHEM.featureSize.init( '#eut-feature-section' ); 74 EUTHEM.featureParallax.init(); 75 } 76 if( $('.eut-page-title').length > 0 ){ 77 EUTHEM.featureSection.init( '.eut-page-title' ); 78 EUTHEM.featureSize.init( '.eut-page-title' ); 79 } 80 EUTHEM.pageSettings.init(); 81 EUTHEM.leaderPostSize.init(); 82 EUTHEM.isotope.init(); 83 EUTHEM.isotope.noIsoFilters(); 84 EUTHEM.basicElements.init(); 85 EUTHEM.fullPage.init(); 86 EUTHEM.pillingPage.init(); 87 EUTHEM.parallaxSection.init('.eut-section.eut-bg-parallax'); 88 EUTHEM.sectionNav.init(); 89 } 90 }; 91 92 EUTHEM.reCall = { 93 init: function(){ 94 EUTHEM.sectionSettings.init(); 95 EUTHEM.isotope.init(); 96 } 97 }; 98 99 100 // # Document on Resize 101 // ============================================================================= // 102 EUTHEM.documentResize = { 103 init: function(){ 104 if( $('#eut-feature-section').length > 0 ){ 105 EUTHEM.featureSize.init( '#eut-feature-section' ); 106 } 107 if( $('.eut-page-title').length > 0 ){ 108 EUTHEM.featureSize.init( '.eut-page-title' ); 109 } 110 EUTHEM.sectionSettings.init(); 111 EUTHEM.basicElements.imageText(); 112 EUTHEM.pageSettings.resizeVideoBg(); 113 } 114 }; 115 116 // # Document on Scroll 117 // ============================================================================= // 118 EUTHEM.documentScroll = { 119 init: function(){ 120 EUTHEM.socialBar.init(); 121 EUTHEM.pageSettings.onePageMenu(); 122 } 123 }; 124 125 // # Document on Load 126 // ============================================================================= // 127 EUTHEM.documentLoad = { 128 init: function(){ 129 EUTHEM.stickyHeaderTypes.init(); 130 EUTHEM.anchorSticky.init(); 131 EUTHEM.socialBar.init(); 132 EUTHEM.stickySidebarWidget.init(); 133 EUTHEM.stickySidebar.init(); 134 EUTHEM.basicElements.iconBox(); 135 EUTHEM.pageSettings.fullHeightSeparator(); 136 EUTHEM.pageSettings.columnEffect(); 137 EUTHEM.wooThumbCarousel.init(); 138 EUTHEM.wooProductRating.init(); 139 140 // Location Hash 141 if (window.location.hash) { 142 setTimeout(function() { 143 var target = window.location.hash; 144 if( $(target).length ){ 145 if ( $(target).hasClass('eut-tab-content') || $(target).hasClass('eut-accordion-content') ) { 146 var tabLink = $('.eut-tab-link[data-rel="' + target + '"]:visible'); 147 if ( tabLink.length ) { 148 tabLink.click(); 149 setTimeout(function() { 150 EUTHEM.pageSettings.linkGoToTop( tabLink ); 151 }, 500); 152 } 153 } else { 154 $('html, body').scrollTop( $(target).offset().top ); 155 } 156 } 157 }, 0); 158 } 159 } 160 }; 161 // # Fixed Custom Position Column 162 // ============================================================================= // 163 EUTHEM.customPositionColumn = { 164 init: function(){ 165 $('.eut-column.eut-custom-position').each(function(){ 166 var $column = $(this), 167 columnW, columnX, windowW; 168 169 setup(); 170 171 if( !isMobile.any() ) { 172 $(window).on('resize', resizer); 173 } else { 174 $(window).on('orientationchange', resizer); 175 } 176 function setup(){ 177 resetPosition(); 178 updateParams(); 179 if( columnW + columnX >= windowW ){ 180 resetPosition(); 181 fixedPositionRight(); 182 } 183 184 if( columnX < 0 ){ 185 resetPosition(); 186 fixedPositionLeft(); 187 } 188 } 189 function updateParams(){ 190 columnW = $column.outerWidth(); 191 columnX = $column.offset().left; 192 windowW = $(window).width(); 193 } 194 function resizer(){ 195 var delay; 196 window.clearTimeout(delay);
197 delay = window.setTimeout(function() { 198 setup(); 199 }, 200); 200 } 201 function fixedPositionRight(){ 202 var newPosX = ( windowW - columnW ) - $column.offset().left; 203 $column.css({'left' : newPosX, 'right' : '' }); 204 } 205 function fixedPositionLeft(){ 206 var newPosX = - $column.offset().left; 207 $column.css({'left' : newPosX, 'right' : '' }); 208 } 209 function resetPosition(){ 210 $column.css({'left' : '', 'right' : ''}); 211 } 212 }); 213 } 214 }; 215 216 // SVG Animation 217 EUTHEM.svgAnimation = { 218 init : function(){ 219 if(bodyLoader){ 220 return false; 221 } 222 var $svg = $('.eut-svg-icon'); 223 $svg.each(function(){ 224 var $icon = $(this), 225 duration = $icon.data('duration'), 226 id = $icon.attr('id'), 227 file = $icon.data('file'), 228 myVivus, 229 parentDelay = 0; 230 231 if( $icon.parents('.eut-element').hasClass('eut-animated-item') ){ 232 parentDelay = $icon.parents('.eut-element').data('delay'); 233 } 234 235 $icon.appear(function() { 236 setTimeout(function () { 237 myVivus = new Vivus( id, { 238 duration : duration, 239 file : file, 240 type: 'async', 241 start : 'inViewport' 242 }); 243 }, parentDelay); 244 },{accX: 0, accY: 0}); 245 }); 246 } 247 }; 248 249 250 // # Sticky Header 251 // ============================================================================= // 252 EUTHEM.stickyHeaderTypes = { 253 init : function(){ 254 var $header = $('#eut-header'), 255 $stickyHeader = $header.find('#eut-main-header'), 256 stickyHeader = $stickyHeader.hasClass('eut-header-logo-top') ? '#eut-bottom-header' : '#eut-main-header', 257 stickyType = $header.data('sticky'), 258 stickyDevice = $header.data('devices-sticky'), 259 responsiveThreshold = parseInt(fildisi_eutf_main_data.responsive_thershold) - 1; 260 261 if( stickyType === 'simple' ) { 262 EUTHEM.stickyHeader.init({ 263 header: '#eut-header', 264 stickyHeader : '#eut-main-header', 265 headerOfsset : false, 266 scrollDirection : false, 267 responsive : [responsiveThreshold,6000] 268 }); 269 } 270 271 if( stickyType === 'shrink') { 272 EUTHEM.stickyHeader.init({ 273 header: '#eut-header', 274 stickyHeader : '#eut-main-header', 275 headerOfsset : false, 276 scrollDirection : false, 277 responsive : [responsiveThreshold,6000] 278 }); 279 } 280 281 if( stickyType === 'advanced') { 282 EUTHEM.stickyHeader.init({ 283 header: '#eut-header', 284 stickyHeader : '#eut-main-header', 285 headerOfsset : true, 286 stickyTopHeader : true, 287 scrollDirection : true, 288 responsive : [responsiveThreshold,6000] 289 }); 290 } 291 292 if( stickyType === 'fildisi') { 293 EUTHEM.stickyHeader.init({ 294 header : '#eut-header', 295 stickyHeader : '#eut-fildisi-sticky-header', 296 headerOfsset : true, 297 stickyTopHeader : false, 298 scrollDirection : true, 299 responsive : [responsiveThreshold,6000] 300 }); 301 } 302 303 if( stickyDevice === 'yes' ) { 304 EUTHEM.stickyHeader.init({ 305 header : '#eut-responsive-header', 306 stickyHeader : '#eut-main-responsive-header', 307 headerOfsset : false, 308 stickyTopHeader : false, 309 scrollDirection : false, 310 responsive: [0,responsiveThreshold + 1] 311 }); 312 } 313 } 314 }; 315 316 // # Simple Sticky Header 317 // ============================================================================= // 318 var goToTop = false; 319 EUTHEM.stickyHeader = { 320 config : { 321 header: '#eut-header', 322 stickyHeader : '#eut-main-header', 323 stickyTopBar : '#eut-top-bar.eut-sticky-topbar .eut-wrapper', 324 headerOfsset : false, 325 stickyTopHeader : false, 326 scrollDirection : false, 327 responsive : [1023,6000] 328 }, 329 init : function(settings){ 330 331 $.extend(this.config, settings); 332 333 var $header = $(this.config.header), 334 $headerSticky = $(this.config.stickyHeader), 335 $topBarSticky = $(this.config.stickyTopBar), 336 headerOfsset = this.config.headerOfsset, 337 stickyTopHeader = this.config.stickyTopHeader, 338 scrollDir = this.config.scrollDirection, 339 minWidth = this.config.responsive[0], 340 maxWidth = this.config.responsive[1], 341 lastScroll = 0, 342 tolerance = { up : 0, down : 0 }, 343 frameSize = 0, 344 delay, headerH, topbarH, windowW, headerT, offset, topPosition, wpBarHeight; 345 346 if( !$header ) return; 347 setup(); 348 349 if( !isMobile.any() ) { 350 $(window).on('resize', resizer); 351 } else { 352 tolerance = { up : 6, down : 5 }; 353 $(window).on('orientationchange', resizer); 354 } 355 356 function setup(){ 357 resetParams(); 358 updateParams(); 359 if (windowW + scrollBarWidth > minWidth && windowW + scrollBarWidth < maxWidth) { 360 update();
361 $(window).on('scroll.stickyHeader', update); 362 } else { 363 $(window).off('scroll.stickyHeader', update); 364 } 365 } 366 function resetParams(){ 367 if( 'eut-responsive-header' != $header.attr('id') ) { 368 removeFixedHeader(); 369 } 370 } 371 function updateParams(){ 372 wpBarHeight = $('body').hasClass('admin-bar') && $(window).width() > 783 ? 32 : 0; 373 wpBarHeight = $('body').hasClass('admin-bar') && $(window).width() > 600 && $(window).width() < 783 ? 46 : wpBarHeight; 374 headerH = $header.outerHeight(); 375 windowW = $(window).width(); 376 frameSize = $('body').hasClass('eut-framed') && windowW + scrollBarWidth > tabletPortrait ? $('#eut-frames').data('frame-size') : 0; 377 headerT = getOffset( $header ); 378 topbarH = $('#eut-top-bar').length && ( $('#eut-top-bar').hasClass('eut-sticky-topbar') || $('#eut-top-bar').hasClass('eut-device-sticky-topbar') ) ? $('#eut-top-bar').outerHeight() : 0; 379 offset = !headerOfsset ? headerT - topbarH : headerT + headerH; 380 offset = Math.round(offset); 381 topPosition = !stickyTopHeader ? topbarH : -(headerH - topbarH); 382 } 383 function resizer(){ 384 window.clearTimeout(delay); 385 delay = window.setTimeout(function() { 386 setup(); 387 }, 200); 388 } 389 function getOffset(el){ 390 return el.offset().top - frameSize - wpBarHeight; 391 } 392 function removeFixedTopBar(){ 393 $('#eut-top-bar').removeClass('eut-fixed'); 394 $header.css({ 'top' : '' }); 395 $topBarSticky.css({ 'top' : '' }); 396 } 397 function addFixedTopBar(){ 398 $('#eut-top-bar').css({'height' : topbarH }).addClass('eut-fixed'); 399 $topBarSticky.css({ 'top' : frameSize + wpBarHeight }); 400 } 401 function removeFixedHeader(){ 402 $header.removeClass('eut-fixed').css({ 'top' : '' }); 403 $headerSticky.css({ 'top' : '' }); 404 $('#eut-top-bar').removeClass('eut-fixed').css({ 'height' : '' }); 405 } 406 function addFixedHeader(){ 407 $header.addClass('eut-fixed').css({ 'top' : topbarH }); 408 $headerSticky.css({ 'top' : topPosition + frameSize + wpBarHeight }); 409 } 410 function addSticky(){ 411 $header.addClass('eut-sticky-header eut-sticky-animate'); 412 } 413 function removeSticky(){ 414 $header.removeClass('eut-sticky-header eut-scroll-up'); 415 } 416 function addScrollUp(){ 417 $header.addClass('eut-scroll-up').removeClass('eut-scroll-down'); 418 } 419 function addScrollDown(){ 420 $header.addClass('eut-scroll-down').removeClass('eut-scroll-up'); 421 } 422 function toleranceExceeded(scroll, direction) { 423 return Math.abs(scroll - lastScroll) >= tolerance[direction]; 424 } 425 function shouldUnpin(scroll, toleranceExceed, sticky){ 426 var scrollingDown = scroll > lastScroll; 427 return scrollingDown && toleranceExceed && sticky; 428 } 429 function shouldPin(scroll, toleranceExceed, sticky){ 430 var scrollingUp = scroll < lastScroll; 431 return scrollingUp && toleranceExceed && sticky; 432 } 433 434 function update(){ 435 var scroll = $(window).scrollTop(), 436 scrollDirection = scroll > lastScroll ? 'down' : 'up', 437 toleranceExceed = toleranceExceeded(scroll, scrollDirection), 438 sticky = false; 439 440 if (scroll >= offset) { 441 addFixedHeader(); 442 } else { 443 removeFixedHeader(); 444 } 445 446 if (scroll >= 0 ) { 447 addFixedTopBar(); 448 } else { 449 removeFixedTopBar(); 450 } 451 452 if (scroll > offset) { 453 addSticky(); 454 sticky = true; 455 } else { 456 removeSticky(); 457 sticky = false; 458 } 459 460 if(shouldUnpin(scroll, toleranceExceed, sticky) && scrollDir) { 461 addScrollDown(); 462 } 463 else if(shouldPin(scroll, toleranceExceed, sticky) && scrollDir) { 464 addScrollUp(); 465 } 466 467 lastScroll = scroll; 468 } 469 470 } 471 }; 472 473 // # Advanced Hidden Menu 474 // ============================================================================= // 475 EUTHEM.advancedHiddenMenu = { 476 init : function(){ 477 var $header = $('#eut-header'), 478 $mainHeader = $('#eut-main-header'), 479 $menu = $('#eut-main-menu'), 480 $menuEl = $menu.find('.eut-first-level'), 481 $headerEl = $mainHeader.find('.eut-header-elements-wrapper'), 482 $btn = $mainHeader.find('.eut-hidden-menu-btn a'), 483 openHeader = false, 484 hoverDelay; 485 486 if( !$menu.length || !$header.hasClass('eut-advanced-hidden-menu') ) return; 487 488 $mainHeader.on('mouseenter.advancedHidden', function(){ 489 var $that = $(this); 490 if( !openHeader ){ 491 openHeader = true; 492 toggleHeader(); 493 } 494 495 }); 496 497 $mainHeader.on('mouseleave.advancedHidden', function(){ 498 var $that = $(this); 499 if( openHeader ){ 500 openHeader = false;
501 toggleHeader(); 502 } 503 }); 504 505 $btn.on('click.advancedHidden', function(e){ 506 e.preventDefault(); 507 if( !openHeader ){ 508 openHeader = true; 509 toggleHeader(); 510 } else { 511 openHeader = false; 512 toggleHeader(); 513 } 514 }); 515 516 if( isMobile.any() ) { 517 $mainHeader.off('mouseenter.advancedHidden'); 518 $mainHeader.off('mouseleave.advancedHidden'); 519 } 520 521 var itemLength = $menuEl.length -1, 522 startTimer = false, 523 count = -1, 524 counter; 525 526 function toggleHeader(){ 527 if( openHeader ){ 528 clearInterval(hoverDelay); 529 $header.addClass('eut-header-hover'); 530 $menuEl.removeClass('hide'); 531 532 // Show Menu 533 startTimer = true; 534 counter = setInterval(timer, 100); 535 536 } else { 537 hoverDelay = setTimeout(function(){ 538 $header.removeClass('eut-header-hover'); 539 $menuEl.removeClass('show'); 540 $headerEl.removeClass('show'); 541 },400); 542 543 // Hide Menu 544 startTimer = false; 545 count = -1; 546 clearInterval(counter); 547 $header.removeClass('eut-open-menu'); 548 $menuEl.addClass('hide'); 549 } 550 } 551 552 function timer() { 553 count += 1; 554 if (count >= itemLength) { 555 clearInterval(counter); 556 $header.addClass('eut-open-menu'); 557 $headerEl.addClass('show'); 558 } 559 $menuEl.eq(count).addClass('show'); 560 } 561 } 562 }; 563 564 // # Leader Post Size 565 // ============================================================================= // 566 EUTHEM.leaderPostSize = { 567 init : function(){ 568 var $leaderElement = $('.eut-blog-leader.eut-layout-1.eut-fildisi-style'); 569 570 if( !$leaderElement.length ) return; 571 572 var windowWidth, 573 maxHeight, 574 leaderHeight; 575 576 $leaderElement.each(function(){ 577 var $this = $(this), 578 $leaderPost = $this.find('.eut-post-leader'), 579 resizing = false; 580 581 582 resetHeight(); 583 $(window).smartresize(resetHeight); 584 585 function resetHeight(){ 586 if(!resizing){ 587 resizing = true; 588 589 $leaderPost.css({ 590 'height' : '' 591 }); 592 593 updateParams(); 594 } 595 } 596 597 function updateParams() { 598 windowWidth = $(window).width(); 599 600 $this.imagesLoaded('always',function(){ 601 maxHeight = $this.outerHeight(); 602 leaderHeight = $leaderPost.outerHeight(); 603 604 setLeaderHeight(); 605 }); 606 } 607 608 function setLeaderHeight(){ 609 if( maxHeight > leaderHeight && windowWidth + scrollBarWidth > tabletPortrait ){ 610 $leaderPost.css({ 611 'height' : maxHeight, 612 'visibility' : 'visible' 613 }); 614 } else { 615 $leaderPost.css({ 616 'visibility' : 'visible' 617 }); 618 } 619 620 resizing = false; 621 } 622 }); 623 } 624 }; 625 626 // # Anchor Sticky 627 // ============================================================================= // 628 EUTHEM.anchorSticky = { 629 init : function(){ 630 var base = EUTHEM.anchorSticky; 631 base.$anchor = $('.eut-anchor-menu'); 632 if( base.$anchor.length ){ 633 base.$anchorWrapper = base.$anchor.find('.eut-anchor-wrapper'); 634 base.$header = $('#eut-header'); 635 base.$mLogo = $('#eut-fildisi-sticky-header .eut-logo'); 636 base.$mElements = $('#eut-fildisi-sticky-header .eut-header-elements-wrapper'); 637 base.$mainHeader = $('#eut-main-header'); 638 base.$topBar = $('#eut-top-bar'); 639 base.styckyType = base.$header.data('sticky'); 640 base.$stickyHeader = base.setStickyHeader(); 641 base.openMenu = false;
642 643 base.setVars(); 644 base.update(); 645 base.responsive(); 646 647 $(window).on('scroll', base.update); 648 if( !isMobile.any() ) { 649 $(window).on("resize",base.update); 650 } else { 651 $(window).on("orientationchange",base.update); 652 } 653 } 654 }, 655 setStickyHeader : function(){ 656 var base = EUTHEM.anchorSticky, 657 stickyHeader; 658 if( base.styckyType !== 'none' ){ 659 if( base.$mainHeader.hasClass('eut-header-default') ) { 660 if( base.styckyType === 'fildisi' ){ 661 stickyHeader = $('#eut-fildisi-sticky-header'); 662 } else { 663 stickyHeader = $('#eut-main-header'); 664 } 665 } else if( base.$mainHeader.hasClass('eut-header-logo-top') ) { 666 stickyHeader = $('#eut-bottom-header'); 667 } 668 } 669 return stickyHeader; 670 }, 671 setVars : function(){ 672 var base = EUTHEM.anchorSticky; 673 base.anchorH = base.$anchor.outerHeight(); 674 base.anchorT = base.$anchor.offset().top; 675 base.topBarH = base.$topBar.length && base.styckyType != 'none' ? base.$topBar.outerHeight() : 0; 676 base.headerH = base.$stickyHeader != undefined ? base.$stickyHeader.outerHeight() : 0; 677 base.frameSize = $('#eut-frames').length ? $('#eut-frames').data('frame-size') : 0; 678 base.mLogoW = base.$mLogo.length ? base.$mLogo.outerWidth() : 0; 679 base.mElementsW = base.$mElements.length ? base.$mElements.outerWidth() : 0; 680 base.newHeaderH = base.headerH; 681 }, 682 setNewHeight : function(){ 683 var base = EUTHEM.anchorSticky; 684 base.headerH = base.$stickyHeader.outerHeight(); 685 if( base.styckyType === 'advanced' || base.styckyType === 'fildisi' ){ 686 base.newHeaderH = 0; 687 } else { 688 base.newHeaderH = base.$stickyHeader.outerHeight(); 689 } 690 }, 691 update : function(){ 692 var base = EUTHEM.anchorSticky; 693 694 if( $(window).width() + scrollBarWidth < tabletPortrait ) { 695 base.$anchor.addClass('eut-anchor-responsive'); 696 return false; 697 } else { 698 base.$anchor.removeClass('eut-anchor-responsive'); 699 } 700 701 if( base.headerH != 0 && base.styckyType != 'none' && base.styckyType != 'simple' ){ 702 base.setNewHeight(); 703 } 704 705 var scroll = $(window).scrollTop(), 706 topOffset = base.anchorT - base.topBarH - base.newHeaderH - base.frameSize - wpBarHeight, 707 topPos = base.topBarH + base.newHeaderH + base.frameSize + wpBarHeight, 708 positionY = base.headerH, 709 sticky = false; 710 711 if( scroll >= topOffset ){ 712 sticky = true; 713 base.$anchorWrapper 714 .addClass('eut-sticky') 715 .css({'top' : topPos}); 716 } else { 717 sticky = false; 718 base.$anchorWrapper 719 .removeClass('eut-sticky') 720 .css({'top' : ''}); 721 } 722 if( base.styckyType === 'fildisi' ){ 723 base.fildisiAnchor(sticky); 724 } 725 if(sticky && base.$header.hasClass('eut-scroll-up') ){ 726 base.$anchorWrapper 727 .addClass('eut-go-down') 728 .removeClass('eut-go-up') 729 .css(base.doTranslate(positionY)); 730 } else if(sticky && base.$header.hasClass('eut-scroll-down') ){ 731 base.$anchorWrapper 732 .addClass('eut-go-up') 733 .removeClass('eut-go-down') 734 .css(base.doTranslate(0)); 735 } else { 736 base.$anchorWrapper 737 .removeClass('eut-go-up') 738 .removeClass('eut-go-down') 739 .css(base.doTranslate(0)); 740 } 741 }, 742 doTranslate : function(value){ 743 return { 744 '-webkit-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 745 '-moz-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 746 '-ms-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 747 '-o-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 748 'transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)' 749 }; 750 }, 751 fildisiAnchor : function(sticky){ 752 var base = EUTHEM.anchorSticky; 753 var leftPos = $('body').hasClass('eut-boxed') ? 'auto' : base.mLogoW + 2; 754 var rightPos = $('body').hasClass('eut-boxed') ? 'auto' : base.mElementsW + 2; 755 var size = $('body').hasClass('eut-boxed') ? '' : 'auto'; 756 757 if( sticky ) { 758 base.$anchorWrapper.css({ 759 'line-height' : base.headerH - 2 +'px', 760 'left' : leftPos, 761 'right' : rightPos, 762 'width' : size, 763 'z-index' : 9999 764 }).addClass('eut-fildisi-anchor'); 765 } 766 if( sticky && base.$header.hasClass('eut-scroll-up') ) { 767 base.$anchorWrapper.css({ 768 'line-height' : '', 769 'left' : '', 770 'right' : '', 771 'width' : '', 772 'z-index' : '' 773 }); 774 } 775 }, 776 responsive : function(){ 777 var base = EUTHEM.anchorSticky, 778 $btn = base.$anchor.find('.eut-anchor-btn'), 779 $menu = base.$anchor.find('.menu'), 780 $menuLink = $menu.find('a'); 781 782 $btn.on('click',function(e){ 783 e.preventDefault(); 784 if(base.openMenu){ 785 base.toggleMenu(true); 786 } else { 787 base.toggleMenu(false); 788 } 789 }); 790 $menuLink.on('click',function(){ 791 if( base.openMenu ){ 792 base.toggleMenu(true); 793 } 794 }); 795 }, 796 toggleMenu : function(bool){ 797 var base = EUTHEM.anchorSticky, 798 $menu = base.$anchor.find('.menu'); 799 if(bool){ 800 base.$anchor.css({'height' : ''}); 801 $menu.slideUp(function(){ 802 base.openMenu = false;
803 }); 804 } else { 805 base.$anchor.css({'height' : 'auto'}); 806 $menu.slideDown(function(){ 807 base.openMenu = true; 808 }); 809 } 810 } 811 }; 812 813 // # Menu Slide or Toggle 814 // ============================================================================= // 815 EUTHEM.slideToggleMenu = { 816 817 init: function( parrent, element ){ 818 819 if( !$(element).length ) return; 820 821 var $menu = $(element), 822 $menuParent = $(parrent), 823 $menuItem = $menu.find('li.menu-item-has-children > a'), 824 menuType = $menuParent.hasClass('eut-slide-menu') ? 'slide' : 'toggle', 825 $arrow = $('<i class="eut-arrow"></i>'), 826 $goBack = $('<li class="eut-goback"><a href="#"><i class="eut-arrow"></i></a></li>'); 827 828 if( menuType === 'slide' ) { 829 // Add Arrows 830 $arrow.appendTo( $menuItem.parent() ); 831 // Add Go Back Button for Slide Menu 832 $goBack.prependTo( $menuItem.parent().find('>ul') ); 833 } else { 834 // Add Arrows 835 $arrow.appendTo( $menuItem ); 836 } 837 838 $menuItem.on('tap click',function(e){ 839 var $this = $(this), 840 link = $this.attr('href'), 841 open = false; 842 843 if((link != '#' || link === '#') && menuType == 'toggle' ) { 844 if( !$this.parent().hasClass('open') && !open ) { 845 e.preventDefault(); 846 $this.parent().addClass('open'); 847 toggle( $this, open ); 848 } else { 849 open = true; 850 toggle( $this, open ); 851 $this.parent().removeClass('open'); 852 } 853 } else if( link === '#' && menuType == 'slide' ) { 854 e.preventDefault(); 855 var listLevel = $this.parents('ul').length, 856 $firstItem = $this.parent().find('ul').first(), 857 menuOffset = $menu.offset().top, 858 offset = $this.offset().top, 859 title = $this.html(); 860 861 appendTitle( title, $firstItem ); 862 863 $firstItem.addClass('show').css({ 'top' : - ( offset - menuOffset ) }); 864 var firstItemH = $firstItem.outerHeight(); 865 866 if( $('body').hasClass('rtl') ) { 867 animRightMenu( firstItemH, listLevel ); 868 } else { 869 animLeftMenu( firstItemH, listLevel ); 870 } 871 } 872 }); 873 874 if( menuType === 'slide' ) { 875 var $arrowBtn = $menuItem.parent().find('.eut-arrow'); 876 $arrowBtn.on('click',function(){ 877 var $this = $(this), 878 listLevel = $this.parents('ul').length, 879 $firstItem = $this.parent().find('ul').first(), 880 menuOffset = $menu.offset().top, 881 offset = $this.offset().top, 882 title = $this.parent().find('a').first().html(); 883 884 appendTitle( title, $firstItem ); 885 886 $firstItem.addClass('show').css({ 'top' : - ( offset - menuOffset ) }); 887 var firstItemH = $firstItem.outerHeight(); 888 889 if( $('body').hasClass('rtl') ) { 890 animRightMenu( firstItemH, listLevel ); 891 } else { 892 animLeftMenu( firstItemH, listLevel ); 893 } 894 895 }); 896 } 897 898 $('li.eut-goback a').on('click', function(e) { 899 e.preventDefault(); 900 var listLevel = $(this).parents('ul ul').length - 1, 901 $firstItem = $(this).closest('.sub-menu'), 902 firstItemH = $firstItem.closest('.menu-item-has-children').closest('ul').height(); 903 904 setTimeout(function(){ 905 $firstItem.removeClass('show'); 906 },300); 907 if( $('body').hasClass('rtl') ) { 908 animRightMenu( firstItemH, listLevel ); 909 } else { 910 animLeftMenu( firstItemH, listLevel ); 911 } 912 }); 913 914 function toggle( $this, open ){ 915 var $subMenu = $this.parent().find('>ul'); 916 if( open ) { 917 $subMenu.slideUp(200); 918 } else { 919 $subMenu.slideDown(200); 920 } 921 } 922 923 function animLeftMenu( height, listLevel ) { 924 $menu.parent().height(height); 925 $menu.css('transform', 'translate3d(' + - listLevel * 100 + '%,0,0)'); 926 } 927 928 function animRightMenu( height, listLevel ) { 929 $menu.parent().height(height); 930 $menu.css('transform', 'translate3d(' + listLevel * 100 + '%,0,0)'); 931 } 932 933 function appendTitle( title, list ){ 934 if( list.find('.eut-goback .eut-item').length ) return; 935 $(title).appendTo( list.find('> .eut-goback a') ); 936 } 937 } 938 939 }; 940 941 // # Sticky Sidebar Widget 942 // ============================================================================= // 943 EUTHEM.stickySidebarWidget = { 944 init: function(){ 945 946 var $stickyWidget = $('#eut-content .eut-sticky-widget'), 947 sidebarWidget = false;
948 949 $stickyWidget.each(function(){ 950 var $this = $(this); 951 952 if( $this.length > 0 ) { 953 954 if( $('.eut-sticky-widget').parent().parent().is('#eut-sidebar') ) { 955 sidebarWidget = true; 956 } 957 958 if( sidebarWidget && $('#eut-sidebar').hasClass('eut-fixed-sidebar') ) return; 959 960 var $content = sidebarWidget ? $('#eut-main-content .eut-main-content-wrapper') : $this.parents('.eut-row'), 961 $sidebar = $this.parent(), 962 headerHeight = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0, 963 anchorHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0, 964 topOffset = headerHeight + anchorHeight + 40; 965 966 var windowWidth,sidebarWidth,sidebarHeight,contentTop,contentPadding,sidebarTop; 967 968 var scrolling = false, 969 sidebarAnimation = false, 970 resizing = false; 971 972 updateParams(); 973 974 if( windowWidth + scrollBarWidth > tabletPortrait ) { 975 $(window).on('scroll', checkSidebar); 976 } 977 $(window).smartresize(resetScroll); 978 979 } 980 981 function checkSidebar() { 982 if( !sidebarAnimation ) { 983 sidebarAnimation = true; 984 updateSidebarPosition(); 985 } 986 } 987 988 function resetScroll() { 989 if( !resizing ) { 990 resizing = true; 991 $sidebar.removeClass('fixed').attr('style', ''); 992 updateParams(); 993 } 994 } 995 996 function updateParams() { 997 windowWidth = $(window).width(); 998 sidebarWidth = $sidebar.width(); 999 sidebarHeight = $sidebar.height(); 1000 contentTop = $content.offset().top; 1001 contentPadding = parseInt( $content.css('padding-top') ); 1002 sidebarTop = $this.offset().top; 1003 1004 $(window).off('scroll', checkSidebar); 1005 1006 if( windowWidth + scrollBarWidth > tabletPortrait ) { 1007 $(window).on('scroll', checkSidebar); 1008 } 1009 resizing = false; 1010 } 1011 1012 function updateSidebarPosition() { 1013 var contentHeight = $content.height(), 1014 scrollTop = $(window).scrollTop(), 1015 topPosition = sidebarTop - contentTop - topOffset - contentPadding; 1016 1017 if( scrollTop < sidebarTop - topOffset ) { 1018 $sidebar.removeClass('fixed').attr('style', ''); 1019 } else if( scrollTop >= sidebarTop - topOffset && scrollTop < sidebarTop + contentHeight - sidebarHeight - topOffset ) { 1020 $sidebar.addClass('fixed').css({ 'top' : - topPosition, 'position' : 'fixed', 'width' : sidebarWidth }); 1021 } else { 1022 if( $sidebar.hasClass('fixed') ) { 1023 $sidebar.removeClass('fixed').css({ 'top' : contentHeight - sidebarHeight + 'px', 'position' : 'relative' }); 1024 } 1025 } 1026 sidebarAnimation = false; 1027 } 1028 }); 1029 } 1030 }; 1031 1032 // # Sticky Sidebar 1033 // ============================================================================= // 1034 EUTHEM.stickySidebar = { 1035 init: function(){ 1036 1037 var $sidebar = $('#eut-sidebar'); 1038 if( $sidebar.length > 0 && $sidebar.hasClass('eut-fixed-sidebar') ) { 1039 1040 var $content = $('#eut-main-content .eut-main-content-wrapper'), 1041 $sidebarWrapper = $sidebar.find('.eut-wrapper'), 1042 headerHeight = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0, 1043 anchorHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0, 1044 topOffset = headerHeight + anchorHeight + 100, 1045 bottomOffset = 0; 1046 1047 var windowWidth,sidebarWidth,sidebarHeight,contentPadding,sidebarTop; 1048 1049 var scrolling = false, 1050 sidebarAnimation = false, 1051 resizing = false; 1052 1053 updateParams(); 1054 1055 if( windowWidth + scrollBarWidth > tabletPortrait ) { 1056 $(window).on('scroll', checkSidebar); 1057 } 1058 1059 $(window).smartresize(resetScroll); 1060 } 1061 1062 function checkSidebar() { 1063 if( !sidebarAnimation ) { 1064 sidebarAnimation = true; 1065 updateSidebarPosition(); 1066 } 1067 } 1068 1069 function resetScroll() { 1070 if( !resizing ) { 1071 resizing = true; 1072 $sidebarWrapper.removeClass('fixed').attr('style', ''); 1073 updateParams(); 1074 } 1075 } 1076 1077 function updateParams() { 1078 windowWidth = $(window).width(); 1079 sidebarWidth = $sidebar.width(); 1080 sidebarHeight = $sidebar.height(); 1081 contentPadding = parseInt( $content.css('padding-top') ); 1082 sidebarTop = $sidebar.offset().top; 1083 1084 if( $('.eut-navigation-bar').length ) { 1085 bottomOffset = $('.eut-navigation-bar').outerHeight() + 60; 1086 } 1087 1088 $(window).off('scroll', checkSidebar); 1089 1090 if( windowWidth + scrollBarWidth > tabletPortrait ) { 1091 checkSidebar(); 1092 $(window).on('scroll', checkSidebar); 1093 } 1094 1095 $sidebar.css({ 1096 'visibility' : 'visible' 1097 }); 1098 1099 resizing = false;
1100 } 1101 1102 function updateSidebarPosition() { 1103 var contentHeight = $content.height(), 1104 scrollTop = $(window).scrollTop(); 1105 1106 if( scrollTop < sidebarTop - topOffset + contentPadding ) { 1107 $sidebarWrapper.removeClass('fixed').attr('style', ''); 1108 } else if( scrollTop >= sidebarTop - topOffset + contentPadding && scrollTop < sidebarTop + contentHeight - sidebarHeight - topOffset + contentPadding - bottomOffset ) { 1109 $sidebarWrapper.addClass('fixed').css({ 'top' : topOffset, 'position' : 'fixed', 'width' : sidebarWidth }); 1110 } else { 1111 if( $sidebarWrapper.hasClass('fixed') ) { 1112 $sidebarWrapper.removeClass('fixed').css({ 'top' : contentHeight - sidebarHeight - bottomOffset + 'px', 'position' : 'relative' }); 1113 } 1114 } 1115 sidebarAnimation = false; 1116 } 1117 1118 } 1119 }; 1120 1121 // # Set Feature Section Size 1122 // ============================================================================= // 1123 EUTHEM.featureSize = { 1124 init: function( section ){ 1125 this.$section = $(section); 1126 this.topBar = $('#eut-top-bar'); 1127 this.header = $('#eut-header'); 1128 this.responsiveHeader = $('#eut-responsive-header'); 1129 this.frameSize = $('body').hasClass('eut-framed') ? $('#eut-frames').data('frame-size') : 0; 1130 this.updateParams(); 1131 var featureHeight; 1132 1133 if( this.$section.hasClass('eut-fullscreen') ) { 1134 featureHeight = this.fullscreenSize(); 1135 } else if( this.$section.hasClass('eut-custom-size') ) { 1136 featureHeight = this.customSize(); 1137 } 1138 }, 1139 updateParams : function(){ 1140 this.windowH = $(window).height(); 1141 this.topBarH = this.getTopBarHeight(); 1142 this.headerH = this.getHeaderHeight(); 1143 }, 1144 getTopBarHeight : function(){ 1145 var height = 0; 1146 if( this.topBar.length && !this.topBar.hasClass('eut-sticky-topbar') ) { 1147 height = this.topBar.outerHeight(); 1148 } 1149 return height; 1150 }, 1151 getHeaderHeight : function(){ 1152 var height = 0; 1153 1154 if( this.header.length && this.header.is(':visible') && !this.header.hasClass('eut-overlapping') && !this.header.hasClass('eut-header-below') ) { 1155 height = this.header.outerHeight(); 1156 } 1157 1158 if( this.responsiveHeader.length && this.responsiveHeader.is(':visible') && !this.header.hasClass('eut-responsive-overlapping') && !this.header.hasClass('eut-header-below') ) { 1159 height = this.responsiveHeader.outerHeight(); 1160 } 1161 1162 return height; 1163 }, 1164 fullscreenSize : function(){ 1165 var sectionH = this.windowH - this.headerH - this.topBarH - (this.frameSize * 2); 1166 this.$section.css( 'height', sectionH).find('.eut-wrapper').css( 'height', sectionH); 1167 return sectionH; 1168 }, 1169 customSize : function(){ 1170 var initHeight = this.$section.data('height'); 1171 var newHeight = ((this.windowH * initHeight) / 100); 1172 if( newHeight > this.windowH ) { 1173 newHeight = this.windowH; 1174 } 1175 this.$section.css( 'height', newHeight).find('.eut-wrapper').css( 'height', newHeight); 1176 return newHeight; 1177 } 1178 }; 1179 1180 // # Feature Section 1181 // ============================================================================= // 1182 EUTHEM.featureSection = { 1183 init : function(section){ 1184 var $section = $(section), 1185 $bgImage = $section.find('.eut-bg-image'), 1186 $bgVideo = $section.find('.eut-bg-video'), 1187 $spinner = $(spinner), 1188 animateContent = false; 1189 1190 if( $bgImage.length ) { 1191 // Load Background Images 1192 loadFeatureImage(); 1193 // Add Spinner 1194 if( addFeatureSpinner ) { 1195 addSpinner(); 1196 } 1197 } else if( !$bgImage.length && $bgVideo.length ) { 1198 // Add Spinner 1199 if( addFeatureSpinner ) { 1200 addSpinner(); 1201 } else { 1202 showFeature(); 1203 } 1204 } else { 1205 // Play Animation Content 1206 featureAnimation( $section ); 1207 } 1208 1209 // Load Background Images 1210 function loadFeatureImage(){ 1211 var totalBgImage = $bgImage.length, 1212 waitImgDone = function() { 1213 totalBgImage--; 1214 if (!totalBgImage) { 1215 // Remove Spinner 1216 if( addFeatureSpinner ) { 1217 setTimeout(function () { 1218 removeSpinner(); 1219 }, 600); 1220 } else { 1221 showFeature(); 1222 } 1223 } 1224 }; 1225 $bgImage.each(function () { 1226 function imageUrl(input) { 1227 return input.replace(/"/g,"").replace(/url\(|\)$/ig, ""); 1228 } 1229 var image = new Image(), 1230 $that = $(this); 1231 image.src = imageUrl($that.css('background-image')); 1232 $(image).on('load',waitImgDone).on( "error", waitImgDone ); 1233 }); 1234 } 1235 1236 // Add Spinner 1237 function addSpinner(){ 1238 $spinner.appendTo( $section ); 1239 $section.addClass('eut-with-spinner'); 1240 } 1241 1242 // Remove Spinner 1243 function removeSpinner(){ 1244 $spinner.fadeOut(900,function(){ 1245 $spinner.remove(); 1246 // Show Feature Section 1247 showFeature(); 1248 }); 1249 } 1250 1251 // Show Feature Section 1252 function showFeature(){ 1253 var $overlay = $section.find('.eut-bg-overlay'), 1254 $content = $section.find('.eut-content'), 1255 $bgImage = $section.find('.eut-bg-image'), 1256 $bgVideo = $section.find('.eut-bg-video'); 1257 1258 $bgImage.addClass('show'); 1259 $bgVideo.addClass('show'); 1260 $overlay.addClass('show'); 1261 1262 animateContent = true; 1263 if( $section.hasClass('eut-with-slider') ) { 1264 // Init Feature Slider 1265 featureSlider(); 1266 } else { 1267 // Play Feature Animation 1268 featureAnimation( $section ); 1269 } 1270 } 1271 1272 // Feature Slider 1273 function featureSlider(){ 1274 var $slider = $('#eut-feature-slider'),
1275 pauseHover = $slider.attr('data-slider-pause') == 'yes' ? true : '', 1276 sliderSpeed = parseInt( $slider.attr('data-slider-speed') ) ? parseInt( $slider.attr('data-slider-speed') ) : 6000, 1277 transition = $slider.attr('data-slider-transition'), 1278 slidersLength = $slider.find('.eut-slider-item').length, 1279 pagination = $slider.attr('data-pagination') != 'no' ? true : false, 1280 $nextNav = $slider.parent().find('.eut-carousel-next'), 1281 $prevNav = $slider.parent().find('.eut-carousel-prev'), 1282 loop = true, 1283 animateOut = false, 1284 animateIn = false, 1285 stopSlider = false; 1286 1287 // Slider Trantition 1288 if( transition != 'slide' ){ 1289 animateOut = 'carousel-' + transition + '-out'; 1290 animateIn = 'carousel-' + transition + '-in'; 1291 } 1292 $slider.on('initialized.owl.carousel changed.owl.carousel',function(event){ 1293 var current = event.item.index, 1294 $currentSlide = $(event.target).find('.eut-slider-item-wrapper').eq(current), 1295 sliderColor = $currentSlide.find('.eut-slider-item').attr('data-header-color'), 1296 color = 'eut-' + sliderColor; 1297 1298 if( !$currentSlide.length) return; 1299 1300 // Slider Animation 1301 featureAnimation( $currentSlide ); 1302 1303 // Set Header Color 1304 if( !$('#eut-main-header').hasClass('eut-header-side') ) { 1305 $('#eut-main-header').removeClass('eut-light eut-dark').addClass(color); 1306 } 1307 1308 // Set Navigation Color 1309 $('#eut-feature-section .eut-carousel-navigation').removeClass('eut-light eut-dark eut-default').addClass(color); 1310 $('#eut-feature-section .owl-controls').removeClass('eut-light eut-dark eut-default').addClass(color); 1311 }); 1312 if ( $slider.find('.eut-slider-item').length == 1 ) { 1313 loop = false; 1314 } 1315 1316 $slider.owlCarousel({ 1317 items : 1, 1318 loop : loop, 1319 autoplay : true, 1320 autoplayTimeout : sliderSpeed, 1321 autoplayHoverPause : pauseHover, 1322 smartSpeed : 500, 1323 dots : pagination, 1324 animateOut : animateOut, 1325 animateIn : animateIn, 1326 itemClass : 'eut-slider-item-wrapper' 1327 }); 1328 1329 $(window).on('scroll',autoplayHandler); 1330 1331 function autoplayHandler(){ 1332 var scroll = $(window).scrollTop(); 1333 if( scroll > 300 && !stopSlider && featureSliderHandler ){ 1334 stopSlider = true; 1335 $slider.trigger('stop.owl.autoplay'); 1336 } else if( scroll < 300 && stopSlider && featureSliderHandler ) { 1337 stopSlider = false;
1338 $slider.trigger('play.owl.autoplay'); 1339 } 1340 } 1341 1342 // Go to the next item 1343 $nextNav.on('click',function(){ 1344 $slider.trigger('next.owl.carousel'); 1345 }); 1346 // Go to the previous item 1347 $prevNav.on('click',function(){ 1348 $slider.trigger('prev.owl.carousel'); 1349 }); 1350 } 1351 1352 // Feature Animation 1353 function featureAnimation(section){ 1354 var $section = section, 1355 $wrapper = $section.find('.eut-title-content-wrapper'), 1356 effect = $section.find('.eut-content').data('animation'), 1357 effectClass = 'eut-animate-' + effect, 1358 delay = 200, 1359 cnt = 0, 1360 contentItems = { 1361 graphic : $section.find(' .eut-graphic '), 1362 subheading : $section.find(' .eut-subheading '), 1363 title : $section.find(' .eut-title '), 1364 description : $section.find(' .eut-description '), 1365 titleMeta : $section.find(' .eut-title-meta-content '), 1366 button1 : $section.find(' .eut-btn-1 '), 1367 button2 : $section.find(' .eut-btn-2 '), 1368 gotoArrow : $section.find(' #eut-goto-section-wrapper ') 1369 }; 1370 1371 // Show Content 1372 $section.find('.eut-content').addClass('show'); 1373 1374 if( !$wrapper.hasClass('eut-bg-none') ){ 1375 contentItems = { 1376 wrapper : $wrapper, 1377 gotoArrow : $section.find(' #eut-goto-section-wrapper ') 1378 }; 1379 } 1380 1381 // Add Animation Class 1382 $.each( contentItems, function( key, item ) { 1383 $(item).removeClass('eut-animate-fade-in eut-animate-fade-in-up eut-animate-fade-in-down eut-animate-fade-in-left eut-animate-fade-in-right eut-animate-zoom-in eut-animate-zoom-out'); 1384 1385 if( $(item).length ){ 1386 cnt++; 1387 if( effect != 'none' ){ 1388 setTimeout(function(){ 1389 $(item).addClass( effectClass ); 1390 },cnt * delay); 1391 } 1392 } 1393 }); 1394 } 1395 } 1396 }; 1397 1398 // # Feature Parallax 1399 // ============================================================================= // 1400 var featureParallaxScroll = false; 1401 EUTHEM.featureParallax = { 1402 init: function(){ 1403 var section = $('#eut-feature-section'), 1404 scroll = false, 1405 smallDelay; 1406 1407 if( !section.hasClass('eut-bg-parallax') && !section.hasClass('eut-bg-advanced-parallax') && !section.hasClass('eut-bg-fixed-section') ) { 1408 return; 1409 } 1410 1411 // Create Parallax Wrapper 1412 section.children().not('.eut-separator-bottom').wrapAll('<div class="eut-parallax-wrapper"></div>'); 1413 1414 updateParallax(); 1415 1416 // Add window events 1417 $(window).on('resize', function(){ 1418 window.clearTimeout(smallDelay); 1419 smallDelay = window.setTimeout(function () { 1420 updateParallax(); 1421 }, 100); 1422 }); 1423 $(window).on('scroll', onWindowScroll); 1424 1425 function onWindowScroll(){ 1426 if( window.requestAnimationFrame ) { 1427 if(!scroll){ 1428 window.requestAnimationFrame( updateParallax ); 1429 scroll = true; 1430 } 1431 } else { 1432 updateParallax(); 1433 } 1434 } 1435 1436 function updateParallax(){ 1437 var wrapper = section.find('.eut-parallax-wrapper'); 1438 var parallaxType; 1439 if( section.hasClass('eut-bg-advanced-parallax') ){ 1440 parallaxType = 'advanced'; 1441 } else if( section.hasClass('eut-bg-fixed-section') ){ 1442 parallaxType = 'fixed'; 1443 } else { 1444 parallaxType = 'classic'; 1445 } 1446 1447 if( inViewport( section ) ){ 1448 // References 1449 var scrollTop = $( window ).scrollTop(); 1450 var sectionTop = section.offset().top; 1451 var sectionW = section.outerWidth(); 1452 var sectionH = section.outerHeight(); 1453 var position = scrollTop * 0.2; 1454 var elementH = sectionH + sectionTop; 1455 var opacity = ( ( ( sectionH + sectionTop ) - scrollTop ) / sectionH ).toFixed(2); 1456 var scale = ( ( ( sectionH + sectionTop ) + scrollTop ) / sectionH ); 1457 var content = section.find('.eut-wrapper, .eut-background-wrapper'); 1458 if( tSupport ){ 1459 1460 if( parallaxType == 'advanced' ) { 1461 wrapper.css({ 1462 'position' : 'fixed', 1463 'top' : sectionTop, 1464 'height' : elementH, 1465 'width' : sectionW, 1466 transform: 'translate3d( 0px' + ', ' + -position + 'px' + ', 0px)', 1467 visibility: 'visible' 1468 }); 1469 content.css({ 1470 // 'opacity' : opacity 1471 }); 1472 } else if( parallaxType == 'fixed' ) { 1473 wrapper.css({ 1474 'position' : 'fixed', 1475 'top' : sectionTop, 1476 'height' : elementH, 1477 'width' : sectionW, 1478 visibility: 'visible' 1479 }); 1480 } else { 1481 wrapper.css({ 1482 'position' : 'relative', 1483 'height' : elementH, 1484 'width' : sectionW, 1485 transform: 'translate3d( 0px' + ', ' + position + 'px' + ', 0px)', 1486 visibility: 'visible' 1487 }); 1488 } 1489 } 1490 } else { 1491 wrapper.css({ 1492 'position' : 'relative' 1493 }); 1494 } 1495 scroll = false;
1496 } 1497 1498 function inViewport( element ){ 1499 var winTop = $( window ).scrollTop(); 1500 var winBottom = winTop + $( window ).height(); 1501 var elTop = element.offset().top; 1502 var elBottom = elTop + element.outerHeight(); 1503 return ( winBottom >= elTop && winTop <= elBottom ); 1504 } 1505 1506 } 1507 }; 1508 1509 // # Woocommerce Carousel Thumb Gallery 1510 // ============================================================================= // 1511 EUTHEM.wooThumbCarousel = { 1512 init : function(){ 1513 var $thumbs = $('#eut-product-feature-image').find('.thumbnails'), 1514 $thumbsWrapper = $thumbs.find('.eut-thumbnails-wrapper'), 1515 $thumbsInner = $thumbs.find('.eut-thumbnails-inner'), 1516 $items = $thumbs.find('.eut-thumb-item'), 1517 $arrowPrev = $('<i class="eut-icon-nav-up-small eut-arrow-prev"></i>'), 1518 $arrowNext = $('<i class="eut-icon-nav-down-small eut-arrow-next"></i>'), 1519 wrapper = false, 1520 smallDelay, 1521 wrapperH, 1522 slidesLength, 1523 cnt; 1524 1525 1526 if( !$thumbs.length || $items.length <= wooThumbCarouselItems ) { 1527 $thumbsWrapper.css({ 1528 'visibility' : 'visible' 1529 }); 1530 return false; 1531 } 1532 1533 setSlider(); 1534 $(window).on('resize', function(){ 1535 window.clearTimeout(smallDelay); 1536 smallDelay = window.setTimeout(function () { 1537 setSlider(); 1538 }, 300); 1539 }); 1540 1541 function addWrapper(){ 1542 if( !wrapper ) { 1543 for (var i = 0, len = $items.length; i < len; i += wooThumbCarouselItems) { 1544 $items.slice(i, i + wooThumbCarouselItems).wrapAll('<div class="eut-thumb-wrapper"/>'); 1545 } 1546 1547 wrapperH = $('.eut-thumb-wrapper').first().outerHeight(); 1548 slidesLength = $('.eut-thumb-wrapper').length - 1; 1549 1550 $thumbsWrapper.css({ 1551 'height' : wrapperH, 1552 'overflow' : 'hidden', 1553 'visibility' : 'visible' 1554 }); 1555 1556 addArrows(); 1557 $thumbsInner.addClass('eut-with-transition'); 1558 1559 wrapper = true; 1560 } 1561 } 1562 1563 function addArrows(){ 1564 $arrowPrev.appendTo( $thumbs ); 1565 $arrowNext.appendTo( $thumbs ); 1566 // Add Classes 1567 $arrowPrev.addClass('eut-disable-arrow'); 1568 $arrowNext.removeClass('eut-disable-arrow'); 1569 1570 cnt = 0; 1571 onEvents(); 1572 } 1573 1574 function moveSlide(n){ 1575 $thumbsInner.css( doTranslate( n * wrapperH ) ); 1576 } 1577 1578 function setSlider(){ 1579 if( $(window).width() + scrollBarWidth < tabletPortrait && wrapper) { 1580 resetSlider(); 1581 } else if( $(window).width() + scrollBarWidth > tabletPortrait && !wrapper) { 1582 addWrapper(); 1583 } 1584 } 1585 1586 function resetSlider(){ 1587 $thumbsInner.removeClass('eut-with-transition'); 1588 $thumbsInner.css( doTranslate( 0 ) ); 1589 $items.unwrap(); 1590 $thumbsWrapper.css({ 1591 'height' : '', 1592 'overflow' : 'visible', 1593 'visibility' : 'visible' 1594 }); 1595 1596 $arrowPrev.remove(); 1597 $arrowNext.remove(); 1598 1599 wrapper = false;
1600 } 1601 1602 function onEvents(){ 1603 $arrowNext.on('click.thumb-arrows',function(){ 1604 var $that = $(this); 1605 if( cnt > - slidesLength ){ 1606 cnt--; 1607 moveSlide( cnt ); 1608 $arrowPrev.removeClass('eut-disable-arrow'); 1609 } 1610 if(cnt == -slidesLength ){ 1611 $that.addClass('eut-disable-arrow'); 1612 } 1613 }); 1614 1615 $arrowPrev.on('click.thumb-arrows',function(){ 1616 var $that = $(this); 1617 if( cnt < 0 ){ 1618 cnt++; 1619 moveSlide( cnt ); 1620 $arrowNext.removeClass('eut-disable-arrow'); 1621 } 1622 if(cnt == 0 ){ 1623 $that.addClass('eut-disable-arrow'); 1624 } 1625 }); 1626 } 1627 1628 function doTranslate( value ){ 1629 return { 1630 '-webkit-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 1631 '-moz-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 1632 '-ms-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 1633 '-o-transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)', 1634 'transform' : 'translate3d(0px, ' + value + 'px, 0px) translateZ(0)' 1635 }; 1636 } 1637 } 1638 }; 1639 1640 // # Woocommerce Product Rating 1641 // ============================================================================= // 1642 EUTHEM.wooProductRating = { 1643 init : function(){ 1644 if ( typeof wc_single_product_params !== 'undefined' ) { 1645 var $rating = $( '.woocommerce-Reviews #respond' ).find( '#rating' ); 1646 if ( $rating.length > 0 && wc_single_product_params.review_rating_required === 'no' ) { 1647 $('.woocommerce-Reviews #respond #rating').removeAttr('required'); 1648 } 1649 } 1650 } 1651 }; 1652 1653 // # Page Settings 1654 // ============================================================================= // 1655 EUTHEM.pageSettings = { 1656 1657 init: function(){ 1658 this.mainMenu(); 1659 this.columnFullHeight(); 1660 this.columnCustomSize(); 1661 this.eutModal(); 1662 this.gotoFirstSection(); 1663 this.bgLoader(); 1664 this.imageLoader(); 1665 this.fitVid(); 1666 this.hiddenArea(); 1667 this.backtoTop(); 1668 this.animatedBg(); 1669 this.onePageSettings(); 1670 this.shoppingCart(); 1671 this.socialShareLinks(); 1672 this.productImageParallax(); 1673 this.lightBox(); 1674 this.postSocials(); 1675 this.fixedFooter(); 1676 }, 1677 bodyLoader: function(){ 1678 var $overflow = $('#eut-loader-overflow'), 1679 $loader = $('.eut-spinner'), 1680 $link = $('a'); 1681 1682 if( $overflow.length > 0 ){ 1683 bodyLoader = true; 1684 } else { 1685 return; 1686 } 1687 1688 if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ 1689 window.onpageshow = function(event) { 1690 if (event.persisted) { 1691 $overflow.removeClass('eut-visible eut-hide'); 1692 window.location.reload(); 1693 } 1694 }; 1695 } else if(navigator.userAgent.indexOf('Firefox') != -1) { 1696 window.onunload = function(){}; 1697 } 1698 1699 if( $overflow.hasClass('eut-page-transition') ) { 1700 var exclude = ['.eut-no-transition', '.eut-toggle-modal'], 1701 comp = new RegExp(location.host); 1702 1703 $('a:not(' + exclude + ')').on('click',function(e){ 1704 var link = this; 1705 if( comp.test(link.href) && link.href.split(/\?|#/)[0] != location.href.split(/\?|#/)[0] && link.target != '_blank' && link.href[0] != '#') { 1706 if( link.href.indexOf( '#' ) == -1 && 1707 link.href.indexOf( 'skype:' ) == -1 && 1708 link.href.indexOf( 'mailto:' ) == -1 && 1709 link.href.indexOf( 'tel:' ) == -1 && 1710 link.href.indexOf( 'jpg' ) == -1 && 1711 link.href.indexOf( 'jpeg' ) == -1 && 1712 link.href.indexOf( 'png' ) == -1 && 1713 link.href.indexOf( 'gif' ) == -1 && 1714 link.href.indexOf( 'bmp' ) == -1 && 1715 link.href.indexOf( 'pdf' ) == -1 && 1716 link.href.indexOf( 'zip' ) == -1 && 1717 link.href.indexOf('add-to-cart=') == -1 ) { 1718 e.preventDefault(); 1719 var newLocation = this.href; 1720 $overflow.addClass('eut-visible').removeClass('eut-hide'); 1721 setTimeout(function(){ 1722 window.location = newLocation; 1723 }, 600); 1724 } 1725 } 1726 }); 1727 } 1728 1729 var images = $('img, .eut-bg-image'); 1730 $.each(images, function(){ 1731 var el = $(this), 1732 image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, ''); 1733 if(image && image !== '' && image !== 'none') 1734 images = images.add($('<img>').attr('src', image)); 1735 if(el.is('img')) 1736 images = images.add(el); 1737 }); 1738 1739 images.imagesLoaded(function(){ 1740 setTimeout(function () { 1741 if( $overflow.hasClass('eut-page-transition') ) { 1742 $overflow.removeClass('eut-visible').addClass('eut-hide'); 1743 setTimeout(function(){ 1744 bodyLoader = false;
1745 EUTHEM.basicElements.animAppear(); 1746 EUTHEM.svgAnimation.init(); 1747 EUTHEM.basicElements.counter(); 1748 }, 1200); 1749 } else { 1750 $loader.fadeOut(500); 1751 $overflow.delay(500).fadeOut(700,function(){ 1752 bodyLoader = false; 1753 EUTHEM.basicElements.animAppear(); 1754 EUTHEM.svgAnimation.init(); 1755 EUTHEM.basicElements.counter(); 1756 }); 1757 } 1758 }, 600); 1759 }); 1760 1761 }, 1762 addVideoBg: function(){ 1763 $('.eut-yt-bg-video').each(function() { 1764 var $element = $(this); 1765 var url = $element.data("video-bg-url"); 1766 var videoID = url.match( /[\\?&]v=([^&#]*)/ )[ 1 ]; 1767 if( '' != videoID ) { 1768 insertYouTubeVideo($element, videoID ); 1769 } 1770 }); 1771 $('.eut-html5-bg-video').each(function() { 1772 var $element = $(this); 1773 EUTHEM.pageSettings.resizeVideoBgElement( $element ); 1774 }); 1775 function insertYouTubeVideo($element, youtubeId, counter) { 1776 if ("undefined" == typeof YT || "undefined" === typeof YT.Player) { 1777 counter = "undefined" === typeof counter ? 0 : counter; 1778 if (100 < counter) { 1779 console.warn("Too many attempts to load YouTube api"); 1780 return; 1781 } 1782 setTimeout(function() { 1783 insertYouTubeVideo($element, youtubeId, counter++); 1784 }, 100); 1785 return; 1786 } 1787 var startSeconds = $element.data('video-start') != undefined ? parseInt( $element.data('video-start') ) : 0; 1788 var endSeconds = $element.data('video-end') != undefined ? parseInt( $element.data('video-end') ) : 0; 1789 var $container = $element.prepend('<div class="eut-bg-youtube-video"><div class="inner"></div></div>').find(".inner"); 1790 var ytPlayer = new YT.Player($container[0], { 1791 width: "100%", 1792 height: "100%", 1793 videoId: youtubeId, 1794 playerVars: { 1795 playlist: youtubeId, 1796 iv_load_policy: 3, 1797 enablejsapi: 1, 1798 disablekb: 1, 1799 autoplay: 1, 1800 controls: 0, 1801 showinfo: 0, 1802 rel: 0, 1803 loop: 1, 1804 start: startSeconds, 1805 end: endSeconds, 1806 wmode: "transparent" 1807 }, 1808 events: { 1809 'onReady': onPlayerReady, 1810 'onStateChange': onPlayerStateChange 1811 } 1812 }); 1813 function onPlayerReady(event) { 1814 event.target.mute().setLoop(true); 1815 } 1816 function onPlayerStateChange(event) { 1817 if ( 0 != startSeconds || 0 != endSeconds ) { 1818 if (event.data === YT.PlayerState.ENDED) { 1819 ytPlayer.loadVideoById({ 1820 videoId: youtubeId, 1821 startSeconds: startSeconds, 1822 endSeconds: endSeconds 1823 }); 1824 } 1825 } 1826 } 1827 // Resize Video 1828 EUTHEM.pageSettings.resizeVideoBgElement( $element ); 1829 } 1830 }, 1831 resizeVideoBg: function(){ 1832 $videoBg.each(function(){ 1833 EUTHEM.pageSettings.resizeVideoBgElement( $(this) ); 1834 }); 1835 }, 1836 resizeVideoBgElement: function( $element ){ 1837 var videoEl, 1838 videoW, 1839 videoH, 1840 marginLeft, 1841 marginTop, 1842 containerW = $element.innerWidth(), 1843 containerH = $element.innerHeight(), 1844 ratio1 = 16, 1845 ratio2 = 9; 1846 1847 if (containerW / containerH < ratio1 / ratio2) { 1848 videoW = containerH * (ratio1 / ratio2); 1849 videoH = containerH; 1850 videoW += 'px'; 1851 videoH += 'px'; 1852 } else { 1853 videoW = containerW; 1854 videoH = containerW * (ratio2 / ratio1); 1855 videoW += 'px'; 1856 videoH += 'px'; 1857 } 1858 if( $element.hasClass('eut-yt-bg-video') || $element.hasClass('eut-iframe-bg-video') ) { 1859 videoEl = 'iframe'; 1860 } else { 1861 videoEl = 'video'; 1862 } 1863 1864 $element.find( videoEl ).css({ 1865 maxWidth: '1000%', 1866 width: videoEl == 'iframe' ? videoW : '', 1867 height: videoH 1868 }); 1869 }, 1870 removeVideoBg: function(){ 1871 $('.eut-background-wrapper').each(function () { 1872 var $wrapper = $(this), 1873 $bgImage = $wrapper.find('.eut-bg-image'), 1874 $bgVideo = $wrapper.find('.eut-bg-video'), 1875 $bgHtml5Video = $wrapper.find('.eut-html5-bg-video'), 1876 $bgYtVideo = $wrapper.find('.eut-yt-bg-video'), 1877 $bgIFrameVideo = $wrapper.find('.eut-iframe-bg-video'), 1878 $bgVideoButton = $wrapper.find('.eut-bg-video-button-device'); 1879 1880 var bgVideoDevice = $bgVideo.data('videoDevice') != undefined ? $bgVideo.data('videoDevice') : 'no'; 1881 if( isMobile.any() && 'no' === bgVideoDevice) { 1882 $bgVideo.remove(); 1883 } else { 1884 1885 if ( $bgHtml5Video.length ) { 1886 var $videoElement = $wrapper.find('.eut-bg-video video'); 1887 var canPlayVideo = false;
1888 $wrapper.find('.eut-bg-video source').each(function(){ 1889 if ( $videoElement.get(0).canPlayType( $(this).attr('type') ) ) { 1890 canPlayVideo = true; 1891 } 1892 }); 1893 if(canPlayVideo) { 1894 $bgImage.remove(); 1895 } else { 1896 $bgVideo.remove(); 1897 } 1898 } 1899 if ( $bgYtVideo.length || $bgIFrameVideo.length ) { 1900 $bgImage.remove(); 1901 } 1902 if ( $bgVideoButton.length ) { 1903 $bgVideoButton.remove(); 1904 } 1905 } 1906 }); 1907 1908 }, 1909 linkGoToTop: function( element, delay, space ){ 1910 1911 var $this = element, 1912 elementTop = $this.offset().top, 1913 header = $('#eut-header').length && $('#eut-main-header').is(":visible") ? true : false, 1914 responsiveHeader = $('#eut-responsive-header').length && $('#eut-responsive-header').is(":visible") ? true : false, 1915 headerHeight = header && $('#eut-header').data('sticky') != 'none' ? $('#eut-main-header').outerHeight() : 0, 1916 respHeaderH = responsiveHeader && $('#eut-header').data('devices-sticky') == 'yes' ? $('#eut-responsive-header').outerHeight() : 0, 1917 topBarHeight = $('#eut-top-bar').length ? $('#eut-top-bar').height() : 0, 1918 anchorBarHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0, 1919 delayAnim = delay != undefined ? delay : 300, 1920 topSpace = space != undefined ? space : 0, 1921 offset = topBarHeight + wpBarHeight + headerHeight + respHeaderH + anchorBarHeight + topSpace; 1922 if( elementTop > 0 ){ 1923 $('html, body').delay(delayAnim).animate({ 1924 scrollTop: elementTop - offset 1925 }, 900, 'easeInOutCubic'); 1926 $("html, body").on("scroll mousedown DOMMouseScroll mousewheel keyup", function(){ 1927 $('html, body').stop(); 1928 }); 1929 return false; 1930 } 1931 }, 1932 mainMenu: function(){ 1933 var $mainMenu = $('#eut-header .eut-horizontal-menu ul.eut-menu'); 1934 1935 $('.eut-main-menu').find( 'a[href="#"]').on('click',function(e){ 1936 e.preventDefault(); 1937 }); 1938 1939 $mainMenu.superfish({ 1940 popUpSelector: '.sub-menu', 1941 delay: 300, 1942 speed: 'fast',
1943 cssArrows: false, 1944 onBeforeShow: function(){ 1945 1946 var $subMenu = $(this); 1947 if( !$subMenu.length ) return; 1948 var $li = $subMenu.parent(), 1949 windowW = $(window).width(), 1950 subMenuW = $subMenu.width(), 1951 liOffsetL = $li.offset().left; 1952 if( $li.hasClass('megamenu') && $li.css('position') == 'relative' ){ 1953 if(subMenuW + liOffsetL > windowW) { 1954 var left = windowW - (subMenuW + liOffsetL); 1955 $subMenu.css({'left' : left}); 1956 } 1957 } 1958 if( !$li.hasClass('eut-first-level') && !$li.hasClass('megamenu') ){ 1959 var subMenuLength = $li.find('.sub-menu').length + 1, 1960 subMenuOffsetL = $li.parents('.eut-first-level').offset().left; 1961 if( (subMenuW * subMenuLength) + subMenuOffsetL > windowW) { 1962 $li.addClass('eut-invert'); 1963 } 1964 } 1965 if( $('body').hasClass('eut-boxed') && ( $li.hasClass('megamenu column-3') || $li.hasClass('megamenu column-2') ) ){ 1966 var containerW = $('#eut-theme-wrapper').width(), 1967 containerL = $('#eut-theme-wrapper').offset().left, 1968 positionL = 0; 1969 1970 if( subMenuW + liOffsetL > containerW + containerL ){ 1971 positionL = (containerW + containerL) - (subMenuW + liOffsetL); 1972 } 1973 1974 $subMenu.css({ 1975 'left' : positionL 1976 }); 1977 } 1978 }, 1979 onHide: function(){ 1980 var $subMenu = $(this), 1981 $li = $subMenu.parent(); 1982 $li.removeClass('eut-invert'); 1983 } 1984 }); 1985 }, 1986 columnFullHeight: function(){ 1987 var $column = $('.eut-column-fullheight'); 1988 1989 $column.each(function(){ 1990 var $that = $(this), 1991 fullTabletL = $that.data('tablet-landscape-fullheight') != undefined ? false : true, 1992 fullTabletP = $that.data('tablet-portrait-fullheight') != undefined ? false : true, 1993 fullMobileL = $that.data('mobile-fullheight') != undefined ? false : true; 1994 1995 $that.columnSize({ 1996 equal: false, 1997 middleContent: false, 1998 fullHeight: true, 1999 fullTabletL : fullTabletL, 2000 fullTabletP : fullTabletP, 2001 fullMobileL : fullMobileL 2002 }); 2003 }); 2004 }, 2005 columnCustomSize: function(){ 2006 var $section = $('.eut-section.eut-custom-height'); 2007 $section.each(function(){ 2008 var $that = $(this), 2009 equal = false, 2010 middle = false, 2011 fullHeight = false, 2012 equalTabletL = true, 2013 equalTabletP = true, 2014 equalMobileL = true, 2015 fullTabletL = true, 2016 fullTabletP = true, 2017 fullMobileL = true; 2018 2019 if( $that.hasClass('eut-equal-column') || $that.hasClass('eut-middle-content') ){ 2020 equal = true; 2021 equalTabletL = $that.data('tablet-landscape-equal-columns') != undefined ? false : true; 2022 equalTabletP = $that.data('tablet-portrait-equal-columns') != undefined ? false : true; 2023 equalMobileL = $that.data('mobile-equal-columns') != undefined ? false : true; 2024 } 2025 if( $that.hasClass('eut-middle-content') ){ 2026 middle = true; 2027 } 2028 if( $that.hasClass('eut-fullheight') ){ 2029 fullHeight = true; 2030 fullTabletL = $that.data('tablet-landscape-fullheight') != undefined ? false : true; 2031 fullTabletP = $that.data('tablet-portrait-fullheight') != undefined ? false : true; 2032 fullMobileL = $that.data('mobile-fullheight') != undefined ? false : true; 2033 } 2034 $that.columnSize({ 2035 equal : equal, 2036 middleContent : middle, 2037 fullHeight : fullHeight, 2038 equalTabletL : equalTabletL, 2039 equalTabletP : equalTabletP, 2040 equalMobileL : equalMobileL, 2041 fullTabletL : fullTabletL, 2042 fullTabletP : fullTabletP, 2043 fullMobileL : fullMobileL 2044 }); 2045 }); 2046 }, 2047 columnEffect: function(){ 2048 var $parallaxColumn = $('.eut-parallax-effect'), 2049 $section = $parallaxColumn.parents('.eut-section'); 2050 2051 $parallaxColumn.each(function(){ 2052 var $that = $(this), 2053 parallaxEffect = $that.data('parallax-effect'), 2054 tabletL = $that.data('tablet-landscape-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false, 2055 tabletP = $that.data('tablet-portrait-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false, 2056 mobileL = $that.data('mobile-parallax-effect') != 'none' && parallaxEffect == 'vertical-parallax' ? true : false, 2057 $section = $that.parents('.eut-section'); 2058 2059 imagesLoaded( $section, function() { 2060 $that.paraller({ 2061 tabletL : [tabletLandscape, tabletL], 2062 tabletP : [tabletPortrait, tabletP], 2063 mobileL : [mobileScreen, mobileL] 2064 }); 2065 }); 2066 }); 2067 }, 2068 eutModal: function(){ 2069 2070 var $button = $('.eut-toggle-modal'), 2071 $overlay = $('<div id="eut-modal-overlay" class="eut-body-overlay"></div>'), 2072 $closeBtn = $('<div class="eut-close-modal"><i class="eut-icon-close"></i></div>'), 2073 $themeWrapper = $('#eut-theme-wrapper'), 2074 content; 2075 2076 $button.on('click',function(e){ 2077 content = $(this).attr('href'); 2078 if( content.indexOf("#") === 0 && $(content).length > 0 ) { 2079 e.preventDefault(); 2080 2081 // Append Overlay on body 2082 $overlay.appendTo( $themeWrapper ); 2083 $closeBtn.appendTo( $(content) ); 2084 2085 $(content).addClass('prepare-anim'); 2086 2087 openModal(); 2088 2089 $closeBtn.on('click',function(e){ 2090 e.preventDefault(); 2091 closeModal(); 2092 }); 2093 2094 $(content).on('click',function(e){ 2095 if ( !$('.eut-modal-item').is(e.target) && $('.eut-modal-item').has(e.target).length === 0 ) { 2096 e.preventDefault(); 2097 closeModal(); 2098 } 2099 }); 2100 } 2101 }); 2102 2103 // Open Modal 2104 function openModal() { 2105 $overlay.fadeIn(function(){ 2106 $(content).addClass('animate'); 2107 2108 // Search Modal 2109 if( $(content).is('#eut-search-modal') ){ 2110 var $searchContent = $('#eut-search-modal'), 2111 $searchInput = $searchContent.find('.eut-search-textfield'); 2112 2113 $searchInput.val(''); 2114 setTimeout(function(){ 2115 $searchInput.focus(); 2116 },600); 2117 } 2118 }); 2119 } 2120
2121 // Close Modal 2122 function closeModal() { 2123 $(content).removeClass('animate mobile'); 2124 setTimeout(function(){ 2125 $overlay.fadeOut(function(){ 2126 $(content).removeClass('prepare-anim'); 2127 $overlay.remove(); 2128 $closeBtn.remove(); 2129 }); 2130 },600); 2131 } 2132 2133 $(document).on('keyup',function(evt) { 2134 if (evt.keyCode == 27 && $(content).hasClass('animate') ) { 2135 closeModal(); 2136 } 2137 }); 2138 2139 }, 2140 gotoFirstSection: function(){ 2141 var $selector = $('#eut-feature-section #eut-goto-section'), 2142 $nextSection = $('#eut-content'), 2143 $stickyHeader = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0; 2144 2145 $selector.on('click',function(){ 2146 if( $nextSection.length ){ 2147 $('html,body').animate({ 2148 scrollTop: $nextSection.offset().top - $stickyHeader 2149 }, 1000); 2150 return false; 2151 } 2152 }); 2153 }, 2154 bgLoader: function() { 2155 2156 var $selector = $('#eut-header .eut-bg-image, #eut-content .eut-bg-image, #eut-footer .eut-bg-image, .eut-navigation-bar .eut-bg-image, #eut-sidearea .eut-bg-image'); 2157 $selector.each(function () { 2158 var $selector = $(this); 2159 if( $selector.data('loader') == 'yes' ){ 2160 EUTHEM.pageSettings.addSpinner( $selector ); 2161 } 2162 function imageUrl(input) { 2163 return input.replace(/"/g,"").replace(/url\(|\)$/ig, ""); 2164 } 2165 var image = new Image(), 2166 $that = $(this); 2167 image.src = imageUrl($that.css('background-image')); 2168 image.onload = function () { 2169 if( $selector.data('loader') == 'yes' ){ 2170 EUTHEM.pageSettings.removeSpinner( $selector ); 2171 } else { 2172 $that.addClass('show'); 2173 } 2174 }; 2175 }); 2176 }, 2177 imageLoader: function(){ 2178 var selectors = { 2179 singleImage : '.eut-image', 2180 media : '.eut-media' 2181 }; 2182 $.each(selectors, function(key, value){ 2183 if( $(this).length ){ 2184 var item = $(this), 2185 imgLoad = imagesLoaded( item ); 2186 imgLoad.on( 'always', function() { 2187 $(value).find('img').animate({ 'opacity': 1 },1000); 2188 }); 2189 } 2190 }); 2191 }, 2192 addSpinner: function( $selector ){ 2193 var $section = $selector; 2194 $(spinner).appendTo( $section.parent() ); 2195 }, 2196 removeSpinner: function( $selector ){ 2197 2198 var $section = $selector.parent(), 2199 $spinner = $section.find('.eut-spinner'); 2200 2201 $spinner.fadeOut(600,function(){ 2202 $selector.addClass('show'); 2203 $spinner.remove(); 2204 }); 2205 }, 2206 fitVid: function(){ 2207 $('.eut-video, .eut-media').fitVids(); 2208 $('iframe[src*="youtube"]').parent(":not(.eut-bg-youtube-video)").fitVids(); 2209 $('iframe[src*="vimeo"]').parent().fitVids(); 2210 }, 2211 hiddenArea: function( section, btn ){ 2212 var $btn = $('.eut-toggle-hiddenarea'), 2213 $themeWrapper = $('#eut-theme-wrapper'), 2214 $closeBtn = $('.eut-hidden-area').find('.eut-close-btn'), 2215 startTimer = false, 2216 count = -1, 2217 itemLength = 0, 2218 counter, 2219 areaWidth = 0, 2220 content, 2221 $overlay; 2222 2223 $btn.on('click',function(e){ 2224 content = $(this).attr('href'); 2225 if( content.indexOf("#") === 0 && $(content).length > 0 ) { 2226 e.preventDefault(); 2227 var overlayId = content.replace('#',''); 2228 2229 $(content).addClass('prepare-anim'); 2230 $overlay = $('<div id="' + overlayId + '-overlay" class="eut-body-overlay"></div>'); 2231 2232 // Append Overlay on body 2233 $overlay.appendTo( $themeWrapper ); 2234 2235 // Calculate Width 2236 areaWidth = hiddenAreaWidth( content ); 2237 $(window).smartresize(function(){ 2238 areaWidth = hiddenAreaWidth( content ); 2239 }); 2240 2241 // Menu First Level Animation 2242 if(hiddenMenuItemsAnimation){ 2243 $(content).addClass('eut-animated-menu-items'); 2244 } 2245 setTimeout(function(){ 2246 if(hiddenMenuItemsAnimation){ 2247 animMenuItems(content); 2248 } 2249 },1000); 2250 2251 if( $(content).hasClass('open') ) { 2252 closeHiddenArea(); 2253 } else { 2254 openHiddenArea(); 2255 } 2256 2257 // For One Page 2258 var $link = $(content).find('a[href*="#"]:not( [href="#"] )'); 2259 $link.on('click',function(){ 2260 var target = $(this.hash), 2261 targetHash = this.hash, 2262 dataValue = this.hash.replace('#',''); 2263 if ( target.length && ( target.hasClass('eut-section') || target.hasClass('eut-bookmark') || target.hasClass('eut-tab-content') || target.hasClass('eut-accordion-content') ) ) { 2264 closeHiddenArea(); 2265 } 2266 // For Fullpage Scrolling 2267 if( $('[data-anchor="' + dataValue + '"]').length ){ 2268 closeHiddenArea(); 2269 } 2270 //For go to header 2271 if( 'eut-goto-header' == dataValue ){ 2272 closeHiddenArea(); 2273 } 2274 }); 2275 2276 } 2277 }); 2278 2279 $closeBtn.on('click',function(){ 2280 closeHiddenArea(); 2281 }); 2282 2283 // Open Hidden Area 2284 function openHiddenArea() { 2285 $overlay.fadeIn(function(){ 2286 $('body').scrollTop( 0 ); 2287 $(content).addClass('open'); 2288 $(this).on('click',function(){ 2289 closeHiddenArea(); 2290 }); 2291 }); 2292 } 2293 // Close Hidden Area 2294 function closeHiddenArea() { 2295 $themeWrapper.css({ 'height' : 'auto' }); 2296 $(content).removeClass('open'); 2297 $overlay.fadeOut(function(){ 2298 $overlay.remove(); 2299 $(content).removeClass('prepare-anim'); 2300 }); 2301 } 2302 2303 // Calculate Area Width 2304 function hiddenAreaWidth( area ){ 2305 var $area = $(area), 2306 windowWidth = $(window).width(); 2307 2308 if( $(window).width() + scrollBarWidth <= mobileScreen ) { 2309 $(area).css({ 'width' : windowWidth + 30 }); 2310 } else { 2311 if( $area.hasClass('eut-large-width') ) { 2312 $(area).css({ 'width' : Math.max(hiddenaAreaMinWidth, (windowWidth / 2)) }); 2313 } else if( $area.hasClass('eut-medium-width') ) { 2314 $(area).css({ 'width' : Math.max(hiddenaAreaMinWidth, (windowWidth / 3)) }); 2315 } else { 2316 $(area).css({ 'width' : Math.max(hiddenaAreaMinWidth, (windowWidth / 4)) }); 2317 } 2318 } 2319 2320 return areaWidth; 2321 } 2322 2323 // Menu First Level Animation 2324 function animMenuItems(area) { 2325 var $area = $(area), 2326 $menu = $area.find('ul.eut-menu'),
2327 $firstLevel = $menu.find('li.eut-first-level'), 2328 itemLength = $firstLevel.length; 2329 if( itemLength > 0 && !startTimer ){ 2330 startTimer = true; 2331 counter = setInterval(function(){ 2332 timer($firstLevel); 2333 }, 200); 2334 } 2335 2336 function timer($menuItem){ 2337 count += 1; 2338 if (count >= itemLength) { 2339 clearInterval(counter); 2340 } 2341 $menuItem.eq(count).addClass('show'); 2342 } 2343 } 2344 2345 }, 2346 hiddenAreaHeight: function( area ){ 2347 if( !$(area).length ) return; 2348 2349 var windowWidth = $(window).width(), 2350 windowHeight = $(window).height(), 2351 hiddenAreaHeight = $(area).find('.eut-hiddenarea-content').outerHeight() + 200, 2352 $themeWrapper = $('#eut-theme-wrapper'), 2353 $scroller = $(area).find('.eut-scroller'), 2354 $buttonWrapper = $(area).find('.eut-buttons-wrapper'), 2355 btnWrapperHeight = $buttonWrapper.length ? $buttonWrapper.height() : 0, 2356 sideHeight = 0; 2357 2358 if( hiddenAreaHeight > windowHeight ){ 2359 sideHeight = hiddenAreaHeight; 2360 } else { 2361 sideHeight = windowHeight; 2362 } 2363 2364 if( $(window).width() + scrollBarWidth <= mobileScreen ) { 2365 $scroller.css({ 'height' : 'auto' }); 2366 $(area).css({ 'position' : 'absolute','height' : sideHeight }); 2367 $themeWrapper.css({ 'height' : sideHeight, 'overflow' : 'hidden' }); 2368 } else { 2369 $scroller.css({ 'height' : windowHeight - btnWrapperHeight - 150 }); 2370 $themeWrapper.css({ 'height' : '', 'overflow' : '' }); 2371 } 2372 }, 2373 backtoTop: function() { 2374 var selectors = { 2375 topBtn : '.eut-back-top', 2376 dividerBtn : '.eut-divider-backtotop', 2377 topLink : 'a[href="#eut-goto-header"]' 2378 }, 2379 footerBarHeight = $('.eut-footer-bar.eut-fullwidth').length ? $('.eut-footer-bar.eut-fullwidth').outerHeight() : 0; 2380 2381 if( $( selectors.topBtn ).length ) { 2382 2383 $(window).on('scroll', function() { 2384 var scroll = $(this).scrollTop(), 2385 $topBtn = $( selectors.topBtn ); 2386 2387 if (scroll > 600) { 2388 $topBtn.addClass('show'); 2389 } else { 2390 $topBtn.removeClass('show'); 2391 } 2392 if( scroll + $(window).height() > $(document).height() - footerBarHeight ) { 2393 $topBtn.css({ 'transform': 'translate(0, ' + -( footerBarHeight + 80 ) + 'px)' }); 2394 } else { 2395 $topBtn.css({ 'transform': '' }); 2396 } 2397 2398 }); 2399 } 2400 2401 $.each(selectors, function(key, value){ 2402 $(value).on('click', function(e){ 2403 e.preventDefault(); 2404 goToTop = true; 2405 var scrollTop = Math.abs($(window).scrollTop()) / 2, 2406 speed = scrollTop < 1000 ? 1000 : scrollTop; 2407 $('html, body').animate({scrollTop: 0}, speed, 'easeInOutCubic',function(){ 2408 goToTop = false; 2409 }); 2410 }); 2411 }); 2412 2413 }, 2414 animatedBg: function(){ 2415 var $section = $('.eut-section'); 2416 2417 $section.each(function(){ 2418 var $this = $(this); 2419 2420 if( $this.hasClass('eut-bg-animated') ) { 2421 zoomBg( $this ); 2422 } else if( $this.hasClass('eut-bg-horizontal') ) { 2423 horizontalBg( $this ); 2424 } 2425 }); 2426 2427 function zoomBg( $this ){ 2428 $this.mouseenter(function() { 2429 $this.addClass('zoom'); 2430 }); 2431 $this.mouseleave(function() { 2432 $this.removeClass('zoom'); 2433 }); 2434 } 2435 2436 function horizontalBg( $this ){ 2437 var bgPosition = 0; 2438 setInterval(function(){ 2439 bgPosition++; 2440 $this.find('.eut-bg-image').css({ 'background-position' : bgPosition+'px center', 'background-repeat' : 'repeat' }); 2441 },75); 2442 } 2443 }, 2444 onePageSettings: function(){ 2445 $('a[href*="#"]:not( [href="#"] )').on('click',function(e){ 2446 var anchorBarHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0, 2447 headerHeight = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0, 2448 topbarH = $('#eut-top-bar').length && ( $('#eut-top-bar').hasClass('eut-sticky-topbar') || $('#eut-top-bar').hasClass('eut-device-sticky-topbar') ) ? $('#eut-top-bar').outerHeight() : 0, 2449 target = $(this.hash), 2450 targetHash = this.hash; 2451 2452 if( $("#eut-responsive-header").is(":visible") ) { 2453 headerHeight = $('#eut-header').data('devices-sticky') != 'no' ? $('#eut-header').data('devices-sticky-height') : 0; 2454 } else { 2455 if( target.length ){ 2456 headerHeight = ( 'advanced' == $('#eut-header').data('sticky') && target.offset().top > $(this).offset().top ) ? 0 : headerHeight; 2457 } 2458 } 2459 2460 if ( target.length && ( target.hasClass('eut-section') || target.hasClass('eut-bookmark') ) ) { 2461 $('html,body').animate({ 2462 scrollTop: target.offset().top - headerHeight - wpBarHeight - anchorBarHeight - topbarH + 1 2463 }, 1000); 2464 return false;
2465 } 2466 if ( target.length && ( target.hasClass('eut-tab-content') || target.hasClass('eut-accordion-content') ) ) { 2467 var tabLink = $('.eut-tab-link[data-rel="' + targetHash + '"]:visible'); 2468 if ( tabLink.length ) { 2469 tabLink.click(); 2470 setTimeout(function() { 2471 EUTHEM.pageSettings.linkGoToTop( tabLink ); 2472 }, 500); 2473 } 2474 return false; 2475 } 2476 }); 2477 }, 2478 onePageMenu: function(){ 2479 var $section = $('#eut-main-content .eut-section[id]'); 2480 if (!$section.length ) return; 2481 2482 var sideHeader = $('#eut-main-header').hasClass('eut-header-side') ? true : false, 2483 headerHeight = $('#eut-header').attr('data-sticky-header') != 'none' && !sideHeader ? $('#eut-main-header').outerHeight() : 0, 2484 anchorBarHeight = $('.eut-anchor-menu').length ? $('.eut-anchor-menu').outerHeight() : 0, 2485 topbarH = $('#eut-top-bar').length && ( $('#eut-top-bar').hasClass('eut-sticky-topbar') || $('#eut-top-bar').hasClass('eut-device-sticky-topbar') ) ? $('#eut-top-bar').outerHeight() : 0, 2486 offsetTop = headerHeight + anchorBarHeight + topbarH + wpBarHeight, 2487 scroll = $(window).scrollTop(); 2488 2489 $section.each(function(){ 2490 var $that = $(this), 2491 currentId = $that.attr('id'), 2492 sectionOffset = $that.offset().top - offsetTop; 2493 2494 if (sectionOffset <= scroll && sectionOffset + $that.outerHeight() > scroll ) { 2495 $('a[href*="#' + currentId + '"]').parent().addClass('active'); 2496 } 2497 else{ 2498 $('a[href*="#' + currentId + '"]').parent().removeClass("active"); 2499 } 2500 2501 }); 2502 }, 2503 fixedFooter: function(){ 2504 var $footer = $('#eut-footer'), 2505 sticky = $footer.data('sticky-footer'), 2506 prevSection = $footer.prev(), 2507 prevMargin = parseInt( prevSection.css('margin-bottom') ), 2508 delay; 2509 2510 if( !$footer.length || sticky != 'yes' || isMobile.any() ) return; 2511 2512 // On window events 2513 $( window ).on( 'scroll', function(){ 2514 update(); 2515 }); 2516 $(window).on('resize',resizer); 2517 2518 function resizer(){ 2519 window.clearTimeout(delay); 2520 delay = window.setTimeout(function() { 2521 $footer.prev().css( 'margin-bottom','' ); 2522 prevMargin = parseInt( prevSection.css('margin-bottom') ); 2523 update(); 2524 }, 900); 2525 } 2526 2527 update(); 2528 2529 function update(){ 2530 var windowWidth = $(window).width(), 2531 windowHeight = $(window).height(), 2532 footerHeight = $footer.outerHeight(), 2533 margin = footerHeight + prevMargin; 2534 2535 if( ( windowWidth + scrollBarWidth <= tabletLandscape ) || ( footerHeight > windowHeight ) ) { 2536 $footer.removeClass('eut-fixed-footer').prev().css( 'margin-bottom','' ); 2537 } else { 2538 $footer.addClass('eut-fixed-footer').prev().css( 'margin-bottom',margin ); 2539 } 2540 } 2541 2542 }, 2543 shoppingCart: function(){ 2544 var $button = $('.eut-toggle-cart'), 2545 $cart = $('.eut-shoppin-cart-content'), 2546 $cartList = $cart.find('.cart_list'), 2547 timer; 2548 2549 $button.on('mouseover',function(){ 2550 clearTimeout(timer); 2551 openCart(); 2552 }); 2553 2554 $button.on('mouseout',function(){ 2555 closeCart(); 2556 }); 2557 2558 $cart.on('mouseover',function(){ 2559 clearTimeout(timer); 2560 }); 2561 2562 $cart.on('mouseout',function(){ 2563 closeCart(); 2564 }); 2565 2566 function openCart(){ 2567 $cart.addClass('open'); 2568 } 2569 2570 function closeCart(){ 2571 timer = setTimeout(function(){ 2572 $cart.removeClass('open'); 2573 }, 300); 2574 } 2575 }, 2576 productImageParallax: function(){ 2577 $('#eut-product-feature-image .eut-product-parallax-image img').paraller({ 2578 wrapper : '.eut-product-area-wrapper', 2579 effect : 'mouse-move-x', 2580 sensitive : 'normal', 2581 invert : true 2582 }); 2583 }, 2584 lightBox: function(){ 2585 //IMAGE 2586 $('.eut-image-popup').each(function() { 2587 $(this).magnificPopup({ 2588 type: 'image', 2589 preloader: false, 2590 fixedBgPos: true, 2591 fixedContentPos: true, 2592 removalDelay: 200, 2593 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2594 closeOnBgClick: true, 2595 callbacks: { 2596 beforeOpen: function() { 2597 var mfpWrap = this.wrap; 2598 this.bgOverlay.fadeIn(200); 2599 addSpinner( mfpWrap ); 2600 }, 2601 imageLoadComplete: function() { 2602 var $spinner = this.wrap.find('.eut-spinner'), 2603 $content = this.container; 2604 removeSpinner( $spinner, $content ); 2605 2606 }, 2607 beforeClose: function() { 2608 this.wrap.fadeOut(100); 2609 this.container.css({'opacity' : 0}); 2610 this.bgOverlay.fadeOut(100); 2611 }, 2612 }, 2613 image: { 2614 verticalFit: true, 2615 titleSrc: function(item) { 2616 var title = item.el.data( 'title' ) ? item.el.data( 'title' ) : '', 2617 caption = item.el.data('desc') ? '<br><small>' + item.el.data('desc') + '</small>' : ''; 2618 if ( '' === title ) { 2619 title = item.el.find('.eut-title').html() ? item.el.find('.eut-title').html() : ''; 2620 } 2621 if ( '' === caption ) { 2622 caption = item.el.find('.eut-caption').html() ? '<br><small>' + item.el.find('.eut-caption').html() + '</small>' : ''; 2623 } 2624 return title + caption; 2625 } 2626 } 2627 }); 2628 }); 2629 $('.eut-gallery-popup, .eut-post-gallery-popup').each(function() { 2630 $(this).magnificPopup({ 2631 delegate: 'a', 2632 type: 'image', 2633 preloader: false, 2634 fixedBgPos: true, 2635 fixedContentPos: true, 2636 removalDelay: 200, 2637 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2638 closeOnBgClick: true, 2639 callbacks: { 2640 beforeOpen: function() { 2641 var mfpWrap = this.wrap; 2642 this.bgOverlay.fadeIn(200); 2643 addSpinner( mfpWrap ); 2644 }, 2645 imageLoadComplete: function() { 2646 var $spinner = this.wrap.find('.eut-spinner'), 2647 $content = this.container; 2648 removeSpinner( $spinner, $content ); 2649 2650 }, 2651 beforeClose: function() { 2652 this.wrap.fadeOut(100); 2653 this.container.css({'opacity' : 0}); 2654 this.bgOverlay.fadeOut(100); 2655 }, 2656 }, 2657 gallery: { 2658 enabled:true, 2659 tCounter: '%curr% / %total%' 2660 }, 2661 image: { 2662 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 2663 titleSrc: function(item) { 2664 var title = item.el.data( 'title' ) ? item.el.data( 'title' ) : '', 2665 caption = item.el.data('desc') ? '<br><small>' + item.el.data('desc') + '</small>' : ''; 2666 if ( '' === title ) { 2667 title = item.el.find('.eut-title').html() ? item.el.find('.eut-title').html() : ''; 2668 } 2669 if ( '' === caption ) { 2670 caption = item.el.find('.eut-caption').html() ? '<br><small>' + item.el.find('.eut-caption').html() + '</small>' : ''; 2671 } 2672 return title + caption; 2673 } 2674 } 2675 }); 2676 }); 2677 2678 if( 1 == fildisi_eutf_main_data.wp_gallery_popup ) { 2679 $('.gallery').each(function() { 2680 $(this).magnificPopup({ 2681 delegate: 'a', 2682 type: 'image', 2683 preloader: false, 2684 fixedBgPos: true, 2685 fixedContentPos: true, 2686 removalDelay: 200, 2687 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2688 closeOnBgClick: true, 2689 callbacks: { 2690 beforeOpen: function() { 2691 var mfpWrap = this.wrap; 2692 this.bgOverlay.fadeIn(200); 2693 addSpinner( mfpWrap ); 2694 }, 2695 imageLoadComplete: function() { 2696 var $spinner = this.wrap.find('.eut-spinner'), 2697 $content = this.container; 2698 removeSpinner( $spinner, $content ); 2699 2700 }, 2701 beforeClose: function() { 2702 this.wrap.fadeOut(100); 2703 this.container.css({'opacity' : 0}); 2704 this.bgOverlay.fadeOut(100); 2705 }, 2706 }, 2707 gallery: { 2708 enabled:true, 2709 tCounter: '%curr% / %total%' 2710 }, 2711 image: { 2712 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 2713 titleSrc: function(item) { 2714 var title = item.el.closest('.gallery-item').find('.gallery-caption').html() ? item.el.closest('.gallery-item').find('.gallery-caption').html() : ''; 2715 return title; 2716 } 2717 } 2718 }); 2719 }); 2720 } 2721 //Inline Modal Popup 2722 $('.eut-modal-popup').each(function() { 2723 $(this).magnificPopup({ 2724 disableOn: 0, 2725 type: 'inline', 2726 preloader: false, 2727 prependTo: '#eut-theme-wrapper', 2728 fixedBgPos: true, 2729 fixedContentPos: true, 2730 removalDelay: 200, 2731 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2732 closeOnBgClick: true, 2733 callbacks: { 2734 beforeOpen: function() { 2735 var mfpWrap = this.wrap; 2736 this.bgOverlay.fadeIn(200); 2737 addSpinner( mfpWrap ); 2738 this.container.css({'opacity':0}); 2739 }, 2740 open: function() { 2741 var $spinner = this.wrap.find('.eut-spinner'), 2742 $content = this.container; 2743 removeSpinner( $spinner, $content ); 2744 if( $content.find('.eut-isotope').length ) { 2745 setTimeout(function(){ 2746 $('.eut-modal-popup').trigger( "eut_relayout_isotope" ); 2747 },100); 2748 } 2749 2750 if( $content.find('.owl-carousel').length ) { 2751 setTimeout(function(){ 2752 $content.find('.owl-carousel').each(function(){ 2753 var owl = $(this).data('owlCarousel'); 2754 owl.onResize(); 2755 }); 2756 },300); 2757 } 2758 2759 if( $content.find('.eut-map').length ) { 2760 $('.eut-modal-popup').trigger( "eut_resize_map" ); 2761 } 2762 }, 2763 beforeClose: function() { 2764 this.wrap.fadeOut(100); 2765 this.container.css({'opacity' : 0}); 2766 this.bgOverlay.fadeOut(100); 2767 }, 2768 } 2769 }); 2770 }); 2771 //VIDEOS 2772 if ( $('.eut-body').hasClass( 'eut-privacy-video-embeds-disabled' ) ) { 2773 $('.eut-youtube-popup, .eut-vimeo-popup, .eut-video-popup').each(function() { 2774 $(this).attr({"target" : "_blank"}); 2775 }); 2776 } else { 2777 $('.eut-youtube-popup, .eut-vimeo-popup, .eut-video-popup').each(function() { 2778 $(this).magnificPopup({ 2779 disableOn: 0, 2780 type: 'iframe', 2781 preloader: false, 2782 fixedBgPos: true, 2783 fixedContentPos: true, 2784 removalDelay: 200, 2785 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2786 closeOnBgClick: true, 2787 callbacks: { 2788 beforeOpen: function() { 2789 var mfpWrap = this.wrap; 2790 this.bgOverlay.fadeIn(200); 2791 addSpinner( mfpWrap ); 2792 }, 2793 open: function() { 2794 var $spinner = this.wrap.find('.eut-spinner'), 2795 $content = this.container; 2796 removeSpinner( $spinner, $content ); 2797 }, 2798 beforeClose: function() { 2799 this.wrap.fadeOut(100); 2800 this.container.css({'opacity' : 0}); 2801 this.bgOverlay.fadeOut(100); 2802 }, 2803 } 2804 }); 2805 }); 2806 } 2807 2808 $('.eut-page-popup').each(function() { 2809 $(this).magnificPopup({ 2810 disableOn: 0, 2811 type: 'iframe', 2812 preloader: false, 2813 fixedBgPos: true, 2814 fixedContentPos: true, 2815 removalDelay: 200, 2816 closeMarkup: '<div class="mfp-close eut-close-modal"></div>', 2817 closeOnBgClick: true, 2818 callbacks: { 2819 beforeOpen: function() { 2820 var mfpWrap = this.wrap; 2821 this.bgOverlay.fadeIn(200); 2822 addSpinner( mfpWrap ); 2823 }, 2824 open: function() { 2825 var $spinner = this.wrap.find('.eut-spinner'), 2826 $content = this.container; 2827 removeSpinner( $spinner, $content ); 2828 }, 2829 beforeClose: function() { 2830 this.wrap.fadeOut(100); 2831 this.container.css({'opacity' : 0}); 2832 this.bgOverlay.fadeOut(100); 2833 }, 2834 } 2835 }); 2836 }); 2837 2838 function addSpinner( mfpWrap ){ 2839 $(spinner).appendTo( mfpWrap ); 2840 } 2841 2842 function removeSpinner( spinner, content ){ 2843 setTimeout(function(){ 2844 spinner.fadeOut(1000, function(){ 2845 content.animate({'opacity':1},600); 2846 $('.eut-modal-popup').trigger( 'eut_open_modal' ); 2847 $(spinner).remove(); 2848 }); 2849 }, 700); 2850 } 2851 }, 2852 socialShareLinks: function(){ 2853 $(document).on('click','.eut-social-share-facebook',function(e){ 2854 e.preventDefault(); 2855 window.open( 'https://www.facebook.com/sharer/sharer.php?u=' + $(this).attr('href'), "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ); 2856 return false;
2857 }); 2858 $(document).on('click','.eut-social-share-twitter',function(e){ 2859 e.preventDefault(); 2860 window.open( 'http://twitter.com/intent/tweet?text=' + encodeURIComponent( $(this).attr('title') ) + ' ' + $(this).attr('href'), "twitterWindow", "height=450,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ); 2861 return false; 2862 }); 2863 $(document).on('click','.eut-social-share-linkedin',function(e){ 2864 e.preventDefault(); 2865 window.open( 'http://www.linkedin.com/shareArticle?mini=true&url=' + $(this).attr('href') + '&title=' + encodeURIComponent( $(this).attr('title') ), "linkedinWindow", "height=500,width=820,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ); 2866 return false; 2867 }); 2868 $(document).on('click','.eut-social-share-pinterest',function(e){ 2869 e.preventDefault(); 2870 window.open( 'http://pinterest.com/pin/create/button/?url=' + $(this).attr('href') + '&media=' + $(this).data('pin-img') + '&description=' + encodeURIComponent( $(this).attr('title') ), "pinterestWindow", "height=600,width=600,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ); 2871 return false; 2872 }); 2873 $(document).on('click','.eut-social-share-reddit',function(e){ 2874 e.preventDefault(); 2875 window.open( '//www.reddit.com/submit?url=' + $(this).attr('href'), "redditWindow", "height=600,width=820,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=1" ); 2876 return false; 2877 }); 2878 $(document).on('click','.eut-social-share-tumblr',function(e){ 2879 e.preventDefault(); 2880 window.open( '//www.tumblr.com/share/link?url=' + $(this).attr('href') + '&name=' + encodeURIComponent( $(this).attr('title') ) , "tumblrWindow", "height=600,width=600,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ); 2881 return false; 2882 }); 2883 $(document).on('click','.eut-like-counter-link',function(e){ 2884 e.preventDefault(); 2885 var link = $(this); 2886 var id = link.data('post-id'), 2887 counter = link.parent().find('.eut-like-counter'), 2888 icon = link.find('i'); 2889 2890 var dataParams = { 2891 action:'fildisi_eutf_likes_callback', 2892 eut_likes_id: id, 2893 _eutf_nonce: fildisi_eutf_main_data.nonce_likes 2894 }; 2895 $.post( fildisi_eutf_main_data.ajaxurl, dataParams , function( response ) { 2896 if ( '-1' != response ) { 2897 if( 'active' == response.status ){ 2898 link.addClass('active'); 2899 icon.removeClass('eut-icon-heart-o').addClass('eut-icon-heart'); 2900 } else { 2901 link.removeClass('active'); 2902 icon.removeClass('eut-icon-heart').addClass('eut-icon-heart-o'); 2903 } 2904 counter.html(response.likes); 2905 } 2906 }).fail(function(xhr, status, error) { 2907 }); 2908 }); 2909 }, 2910 postSocials: function(){ 2911 var $social = $('#eut-single-post-meta-sticky .eut-post-socials li a'), 2912 initSize = 36; 2913 2914 if( $(window).width() + scrollBarWidth <= tabletLandscape ) { 2915 return; 2916 } 2917 2918 $social.off('mouseenter').on('mouseenter', function() { 2919 var $this = $(this), 2920 newSize = $this.find('span').outerWidth(); 2921 $this.css('width', newSize + initSize); 2922 }); 2923 2924 $social.off('mouseleave').on('mouseleave', function() { 2925 var $this = $(this); 2926 $this.css('width', initSize); 2927 }); 2928 }, 2929 fullHeightSeparator : function(){ 2930 var $section = $('.eut-separator-fullheight'); 2931 $section.each(function(){ 2932 var $that = $(this), 2933 $separator = $that.find('.eut-separator'), 2934 delay; 2935 2936 setSeparatorH(); 2937 $that.css({ 2938 'visibility' : 'visible' 2939 }); 2940 2941 if( !isMobile.any() ) { 2942 $(window).on("resize",resizer); 2943 } else { 2944 $(window).on("orientationchange",resizer); 2945 } 2946 2947 function resizer(){ 2948 window.clearTimeout(delay);
2949 delay = window.setTimeout(function() { 2950 setSeparatorH(); 2951 }, 300); 2952 } 2953 function getHeight(){ 2954 var height = $that.outerHeight(); 2955 return height; 2956 } 2957 2958 function setSeparatorH(){ 2959 $separator.css({ 2960 'height' : getHeight() 2961 }); 2962 } 2963 }); 2964 } 2965 }; 2966 2967 // # Basic Elements 2968 // ============================================================================= // 2969 EUTHEM.basicElements = { 2970 init: function(){ 2971 this.autoHeadings(); 2972 this.pieChart(); 2973 this.progressBars(); 2974 this.counter(); 2975 this.slider(); 2976 this.testimonial(); 2977 this.flexibleCarousel(); 2978 this.carousel(); 2979 this.advancedPromo(); 2980 this.imageText(); 2981 this.imageTextParallax(); 2982 this.doubleImageText(); 2983 this.portfolioParallax(); 2984 this.teamParallax(); 2985 this.testimonialParallax(); 2986 this.sliderParallax(); 2987 this.messageBox(); 2988 this.wooProduct(); 2989 this.wooProductZoom(); 2990 this.animAppear(); 2991 this.htmlVideoPlayWhenAppear(); 2992 this.accordionToggle(); 2993 this.tabs(); 2994 this.vcAccordion(); 2995 this.vcTab(); 2996 this.productSocials(); 2997 this.countdown(); 2998 this.hovers(); 2999 }, 3000 autoHeadings: function(){ 3001 var $portfolio = $('.eut-portfolio.eut-auto-headings .eut-isotope-item-inner'); 3002 $portfolio.autoHeading({ 3003 compressor : 20, 3004 items : [ 3005 { 'item' : '.eut-title', 'min' : 18, 'max' : 50 } 3006 ] 3007 }); 3008 $('.eut-blog-item.eut-style-2 .eut-blog-item-inner').autoHeading({ 3009 compressor : 10, 3010 items : [ 3011 { 'item' : '.eut-post-title', 'min' : 16, 'max' : 30 } 3012 ] 3013 }); 3014 }, 3015 pieChart: function(){ 3016 3017 $('.eut-chart-number').each(function() { 3018 var $element = $(this), 3019 delay = $element.parent().data('delay') !== '' ? parseInt( $element.parent().data('delay') ) : 0, 3020 size = $element.data('pie-size'), 3021 chartSize = '130'; 3022 if( size == 'small' ){ 3023 chartSize = '100'; 3024 } 3025 if( size == 'large' ){ 3026 chartSize = '160'; 3027 } 3028 3029 $element.css({ 'width' : chartSize, 'height' : chartSize, 'line-height' : chartSize + 'px' }); 3030 3031 if( $element.parents('.eut-modal-element').length ){ 3032 $('.eut-modal-popup').on( 'eut_open_modal', function(){ 3033 EUTHEM.basicElements.pieChartInit( $element, chartSize ); 3034 }); 3035 } else { 3036 $element.appear(function() { 3037 setTimeout(function () { 3038 EUTHEM.basicElements.pieChartInit( $element, chartSize ); 3039 }, delay); 3040 }); 3041 } 3042 }); 3043 3044 }, 3045 pieChartInit: function( $element, size ){ 3046 3047 var activeColor = $element.data('pie-active-color') !== '' ? $element.data('pie-active-color') : 'rgba(0,0,0,1)', 3048 pieColor = $element.data('pie-color') !== '' ? $element.data('pie-color') : 'rgba(0,0,0,0.1)', 3049 pieLineCap = $element.data('pie-line-cap') !== '' ? $element.data('pie-line-cap') : 'round', 3050 lineSize = $element.data('pie-line-size') !== '' ? $element.data('pie-line-size') : '6', 3051 chartSize = size; 3052 3053 3054 $element.easyPieChart({ 3055 barColor: activeColor, 3056 trackColor: pieColor, 3057 scaleColor: false, 3058 lineCap: pieLineCap, 3059 lineWidth: lineSize, 3060 animate: 1500, 3061 size: chartSize 3062 }); 3063 }, 3064 progressBars: function(){ 3065 $('.eut-progress-bar').each(function() { 3066 3067 var $element = $(this); 3068 if( $element.parents('.eut-modal-element').length ){ 3069 $('.eut-modal-popup').on( 'eut_open_modal', function(){ 3070 EUTHEM.basicElements.progressBarsInit( $element ); 3071 }); 3072 } else { 3073 $element.appear(function() { 3074 EUTHEM.basicElements.progressBarsInit( $element ); 3075 }); 3076 } 3077 }); 3078 }, 3079 progressBarsInit: function( $element ){ 3080 var val = $element.attr('data-value'), 3081 percentage = $('<span class="eut-percentage">'+ val + '%'+'</span>'); 3082 3083 $element.find('.eut-bar-line').animate({ width: val + '%' }, 1600); 3084 if( $element.parent().hasClass('eut-style-1') ) { 3085 percentage.appendTo($element.find('.eut-bar')).animate({ left: val + '%' }, 1600); 3086 } else { 3087 percentage.appendTo($element.find('.eut-bar-title')); 3088 } 3089 }, 3090 counter: function(){ 3091 if( bodyLoader === true ){ 3092 return; 3093 } 3094 var selector = '.eut-counter-item span'; 3095 $(selector).each(function(i){ 3096 var elements = $(selector)[i], 3097 thousandsSeparator = $(this).attr('data-thousands-separator') !== '' ? $(this).attr('data-thousands-separator') : ','; 3098 $(elements).attr('id','eut-counter-' + i );
3099 var delay = $(this).parents('.eut-counter').attr('data-delay') !== '' ? parseInt( $(this).parents('.eut-counter').attr('data-delay') ) : 200, 3100 options = { 3101 useEasing : true, 3102 useGrouping : true, 3103 separator : $(this).attr('data-thousands-separator-vis') !== 'yes' ? thousandsSeparator : '', 3104 decimal : $(this).attr('data-decimal-separator') !== '' ? $(this).attr('data-decimal-separator') : '.', 3105 prefix : $(this).attr('data-prefix') !== '' ? $(this).attr('data-prefix') : '', 3106 suffix : $(this).attr('data-suffix') !== '' ? $(this).attr('data-suffix') : '' 3107 }, 3108 counter = new CountUp( $(this).attr('id') , $(this).attr('data-start-val'), $(this).attr('data-end-val'), $(this).attr('data-decimal-points'), 2.5, options); 3109 $(this).appear(function() { 3110 setTimeout(function () { 3111 counter.start(); 3112 }, delay); 3113 }); 3114 }); 3115 }, 3116 slider: function(){ 3117 3118 var $element = $('#eut-main-content .eut-slider-element, #eut-single-media .eut-slider-element'); 3119 3120 $element.each(function(){ 3121 var $slider = $(this), 3122 $nextNav = $slider.parents('.eut-slider').find('.eut-carousel-next'), 3123 $prevNav = $slider.parents('.eut-slider').find('.eut-carousel-prev'), 3124 sliderSpeed = ( parseInt( $slider.attr('data-slider-speed') ) ) ? parseInt( $slider.attr('data-slider-speed') ) : 3000, 3125 transition = $slider.attr('data-slider-transition'), 3126 loop = $slider.attr('data-slider-loop') != 'no' ? true : false, 3127 autoPlay = $slider.attr('data-slider-autoplay') != 'no' ? true : false, 3128 autoHeight = $slider.attr('data-slider-autoheight') == 'yes' ? true : false, 3129 pagination = $slider.attr('data-pagination') != 'no' ? true : false, 3130 animateOut = false, 3131 animateIn = false; 3132 3133 // Slider Trantition 3134 if( $slider.parents('.eut-slider').hasClass('eut-layout-2') || 'fade' == transition ){ 3135 animateOut = 'carousel-fade-out'; 3136 animateIn = 'carousel-fade-in'; 3137 } 3138 3139 if ( $slider.find('.eut-slider-item').length == 1 ) { 3140 loop = false; 3141 } 3142 3143 // Slider Init 3144 $slider.owlCarousel({ 3145 items : 1, 3146 loop : loop, 3147 autoplay : autoPlay, 3148 autoplayTimeout : sliderSpeed, 3149 autoplayHoverPause : false, 3150 smartSpeed : 500, 3151 dots : pagination, 3152 animateOut : animateOut, 3153 animateIn : animateIn, 3154 autoHeight : autoHeight, 3155 itemClass : 'eut-slider-item-wrapper' 3156 }); 3157 3158 // Fixed for Carousel middle content 3159 if( $slider.parents('.eut-section').hasClass('eut-middle-content') ){ 3160 var smallDelay; 3161 EUTHEM.basicElements.fixMiddleCarousel( $slider ); 3162 $slider.parents('.eut-section').data('plugin_columnSize').reCalculate(); 3163 $(window).on('resize',function(){ 3164 window.clearTimeout(smallDelay); 3165 smallDelay = window.setTimeout(function () { 3166 EUTHEM.basicElements.fixMiddleCarousel( $slider ); 3167 }, 300); 3168 }); 3169 } 3170 3171 $slider.parents('.eut-slider').css('visibility','visible'); 3172 3173 // Go to the next item 3174 $nextNav.on('click',function(){ 3175 $slider.trigger('next.owl.carousel'); 3176 }); 3177 // Go to the previous item 3178 $prevNav.on('click',function(){ 3179 $slider.trigger('prev.owl.carousel'); 3180 }); 3181 3182 }); 3183 3184 }, 3185 testimonial: function(){ 3186 3187 var $element = $('.eut-testimonial.eut-carousel-element'); 3188 3189 $element.each(function(){ 3190 var $testimonial = $(this), 3191 sliderSpeed = ( parseInt( $testimonial.attr('data-slider-speed') ) ) ? parseInt( $testimonial.attr('data-slider-speed') ) : 3000, 3192 pagination = $testimonial.attr('data-pagination') != 'no' ? true : false, 3193 paginationSpeed = ( parseInt( $testimonial.attr('data-pagination-speed') ) ) ? parseInt( $testimonial.attr('data-pagination-speed') ) : 400, 3194 transition = $testimonial.attr('data-slider-transition'), 3195 autoHeight = $testimonial.attr('data-slider-autoheight') == 'yes' ? true : false, 3196 autoPlay = $testimonial.attr('data-slider-autoplay') != 'no' ? true : false, 3197 sliderPause = $testimonial.attr('data-slider-pause') == 'yes' ? true : false, 3198 loop = true, 3199 animateOut = false, 3200 animateIn = false;
3201 3202 // Testimonial Trantition 3203 if( $testimonial.hasClass('eut-layout-2') || 'fade' == transition ){ 3204 animateOut = 'carousel-fade-out'; 3205 animateIn = 'carousel-fade-in'; 3206 } 3207 if ( $testimonial.find('.eut-testimonial-element').length == 1 ) { 3208 loop = false; 3209 } 3210 // Testimonial Init 3211 $testimonial.owlCarousel({ 3212 items : 1, 3213 loop : loop, 3214 autoplay : autoPlay, 3215 autoplayTimeout : sliderSpeed, 3216 autoplayHoverPause : sliderPause, 3217 smartSpeed : 500, 3218 dots : pagination, 3219 animateOut : animateOut, 3220 animateIn : animateIn, 3221 autoHeight : autoHeight, 3222 itemClass : 'eut-testimonial-item-wrapper' 3223 }); 3224 3225 // Fixed for Carousel middle content 3226 if( $testimonial.parents('.eut-section').hasClass('eut-middle-content') ){ 3227 var smallDelay; 3228 EUTHEM.basicElements.fixMiddleCarousel( $testimonial ); 3229 $testimonial.parents('.eut-section').data('plugin_columnSize').reCalculate(); 3230 $(window).on('resize',function(){ 3231 window.clearTimeout(smallDelay); 3232 smallDelay = window.setTimeout(function () { 3233 EUTHEM.basicElements.fixMiddleCarousel( $testimonial ); 3234 }, 300); 3235 }); 3236 } 3237 3238 $testimonial.css('visibility','visible'); 3239 3240 }); 3241 }, 3242 flexibleCarousel: function(){ 3243 3244 var $element = $('.eut-flexible-carousel-element'); 3245 3246 $element.each(function(){ 3247 3248 var $carousel = $(this), 3249 $nextNav = $carousel.parents('.eut-flexible-carousel').find('.eut-carousel-next'), 3250 $prevNav = $carousel.parents('.eut-flexible-carousel').find('.eut-carousel-prev'), 3251 sliderSpeed = ( parseInt( $carousel.attr('data-slider-speed') ) ) ? parseInt( $carousel.attr('data-slider-speed') ) : 3000, 3252 pagination = $carousel.attr('data-pagination') != 'no' ? true : false, 3253 paginationSpeed = ( parseInt( $carousel.attr('data-pagination-speed') ) ) ? parseInt( $carousel.attr('data-pagination-speed') ) : 400, 3254 autoHeight = $carousel.attr('data-slider-autoheight') == 'yes' ? true : false, 3255 autoPlay = $carousel.attr('data-slider-autoplay') != 'no' ? true : false, 3256 sliderPause = $carousel.attr('data-slider-pause') == 'yes' ? true : false, 3257 loop = true, 3258 itemNum = parseInt( $carousel.attr('data-items')), 3259 tabletLandscapeNum = $carousel.attr('data-items-tablet-landscape') ? parseInt( $carousel.attr('data-items-tablet-landscape')) : 4, 3260 tabletPortraitNum = $carousel.attr('data-items-tablet-portrait') ? parseInt( $carousel.attr('data-items-tablet-portrait')) : 2, 3261 mobileNum = $carousel.attr('data-items-mobile') ? parseInt( $carousel.attr('data-items-mobile')) : 1, 3262 gap = $carousel.parents('.eut-flexible-carousel').hasClass('eut-with-gap') ? 30 : 0, 3263 padding = $carousel.parents('.eut-flexible-carousel').hasClass('eut-with-gap') && $carousel.parents('.eut-section').hasClass('eut-fullwidth') ? 30 : 0; 3264 3265 if ( $carousel.find('.eut-flexible-carousel-element').length == 1 ) { 3266 loop = false; 3267 } 3268 3269 // Carousel Init 3270 $carousel.owlCarousel({ 3271 items : 1, 3272 loop : loop, 3273 autoplay : autoPlay, 3274 autoplayTimeout : sliderSpeed, 3275 autoplayHoverPause : sliderPause, 3276 smartSpeed : 500, 3277 dots : pagination, 3278 responsive : { 3279 0 : { 3280 items : mobileNum 3281 }, 3282 768 : { 3283 items : tabletPortraitNum 3284 }, 3285 1024 : { 3286 items : tabletLandscapeNum 3287 }, 3288 1200 : { 3289 items : itemNum 3290 } 3291 }, 3292 margin : gap, 3293 stagePadding : padding, 3294 autoHeight : autoHeight, 3295 itemClass : 'eut-carousel-item-wrapper' 3296 }); 3297 3298 // Fixed for Carousel middle content 3299 if( $carousel.parents('.eut-section').hasClass('eut-middle-content') ){ 3300 var smallDelay; 3301 EUTHEM.basicElements.fixMiddleCarousel( $carousel ); 3302 $carousel.parents('.eut-section').data('plugin_columnSize').reCalculate(); 3303 $(window).on('resize',function(){ 3304 window.clearTimeout(smallDelay); 3305 smallDelay = window.setTimeout(function () { 3306 EUTHEM.basicElements.fixMiddleCarousel( $carousel ); 3307 }, 300); 3308 }); 3309 } 3310 3311 $carousel.css('visibility','visible'); 3312 3313 // Go to the next item 3314 $nextNav.on('click',function(){ 3315 $carousel.trigger('next.owl.carousel'); 3316 }); 3317 // Go to the previous item 3318 $prevNav.on('click',function(){ 3319 $carousel.trigger('prev.owl.carousel'); 3320 }); 3321 3322 }); 3323 }, 3324 carousel: function(){ 3325 3326 var $element = $('.eut-carousel-element'); 3327 3328 $element.each(function(){ 3329 var $carousel = $(this), 3330 $nextNav = $carousel.parents('.eut-carousel').find('.eut-carousel-next'), 3331 $prevNav = $carousel.parents('.eut-carousel').find('.eut-carousel-prev'),
3332 sliderSpeed = ( parseInt( $carousel.attr('data-slider-speed') ) ) ? parseInt( $carousel.attr('data-slider-speed') ) : 3000, 3333 pagination = $carousel.attr('data-pagination') != 'no' ? true : false, 3334 paginationSpeed = ( parseInt( $carousel.attr('data-pagination-speed') ) ) ? parseInt( $carousel.attr('data-pagination-speed') ) : 400, 3335 autoHeight = $carousel.attr('data-slider-autoheight') == 'yes' ? true : false, 3336 autoPlay = $carousel.attr('data-slider-autoplay') != 'no' ? true : false, 3337 sliderPause = $carousel.attr('data-slider-pause') == 'yes' ? true : false, 3338 loop = $carousel.attr('data-slider-loop') != 'no' ? true : false, 3339 itemNum = parseInt( $carousel.attr('data-items')), 3340 tabletLandscapeNum = $carousel.attr('data-items-tablet-landscape') ? parseInt( $carousel.attr('data-items-tablet-landscape')) : 3, 3341 tabletPortraitNum = $carousel.attr('data-items-tablet-portrait') ? parseInt( $carousel.attr('data-items-tablet-portrait')) : 3, 3342 mobileNum = $carousel.attr('data-items-mobile') ? parseInt( $carousel.attr('data-items-mobile')) : 1, 3343 gap = $carousel.parents('.eut-carousel').hasClass('eut-with-gap') && !isNaN( $carousel.data('gutter-size') ) ? Math.abs( $carousel.data('gutter-size') ) : 0, 3344 padding = $carousel.parents('.eut-carousel').hasClass('eut-with-gap') && $carousel.parents('.eut-section').hasClass('eut-fullwidth') && !isNaN( $carousel.data('gutter-size') ) ? Math.abs( $carousel.data('gutter-size') ) : 0; 3345 3346 if ( $carousel.find('.eut-carousel-item').length == 1 ) { 3347 loop = false; 3348 } 3349 3350 // Carousel Init 3351 $carousel.owlCarousel({ 3352 loop : loop, 3353 autoplay : autoPlay, 3354 autoplayTimeout : sliderSpeed, 3355 autoplayHoverPause : sliderPause, 3356 smartSpeed : 500, 3357 dots : pagination, 3358 responsive : { 3359 0 : { 3360 items : mobileNum 3361 }, 3362 768 : { 3363 items : tabletPortraitNum 3364 }, 3365 1024 : { 3366 items : tabletLandscapeNum 3367 }, 3368 1200 : { 3369 items : itemNum 3370 } 3371 }, 3372 margin : gap, 3373 stagePadding : padding, 3374 itemClass : 'eut-carousel-item-wrapper' 3375 }); 3376 3377 // Fixed for Carousel middle content 3378 if( $carousel.parents('.eut-section').hasClass('eut-middle-content') ){ 3379 var smallDelay; 3380 EUTHEM.basicElements.fixMiddleCarousel( $carousel ); 3381 $carousel.parents('.eut-section').data('plugin_columnSize').reCalculate(); 3382 $(window).on('resize',function(){ 3383 window.clearTimeout(smallDelay); 3384 smallDelay = window.setTimeout(function () { 3385 EUTHEM.basicElements.fixMiddleCarousel( $carousel ); 3386 }, 300); 3387 }); 3388 } 3389 3390 $carousel.css('visibility','visible'); 3391 3392 // Go to the next item 3393 $nextNav.on('click',function(){ 3394 $carousel.trigger('next.owl.carousel'); 3395 }); 3396 // Go to the previous item 3397 $prevNav.on('click',function(){ 3398 $carousel.trigger('prev.owl.carousel'); 3399 }); 3400 3401 }); 3402 }, 3403 fixMiddleCarousel : function( $element ){ 3404 $element.css({ 'width' : '0' }); 3405 var $column = $element.parents('.eut-column-wrapper'), 3406 columnW = $column.width() - 1, 3407 owl = $element.data('owlCarousel'); 3408 $element.css({ 'width' : columnW }); 3409 owl.onResize(); 3410 }, 3411 advancedPromo: function(){ 3412 var $item = $('.eut-expandable-info'); 3413 $item.each(function(){ 3414 var $that = $(this), 3415 $wrapper = $that.parents('.eut-section'), 3416 $content = $that.find('.eut-expandable-info-content'), 3417 paddingTop = parseInt( $wrapper.css('padding-top') ), 3418 paddingBottom = parseInt( $wrapper.css('padding-bottom') ); 3419 3420 $wrapper.addClass('eut-pointer-cursor'); 3421 $wrapper.on('click',function(){ 3422 3423 var headerHeight = $('#eut-header').data('sticky') != 'none' ? $('#eut-main-header').outerHeight() : 0, 3424 fieldBarHeight = $('.eut-fields-bar').length ? $('.eut-fields-bar').outerHeight() : 0, 3425 offset = $(this).offset().top, 3426 distance = offset - ( headerHeight + fieldBarHeight ); 3427 3428 if( $content.is(":visible") ){ 3429 $content.slideUp( 600, function(){ 3430 $content.removeClass('show'); 3431 }); 3432 } else { 3433 3434 $('html,body').animate({ 3435 scrollTop: distance 3436 }, 600,function(){ 3437 $content.slideDown( function(){ 3438 $content.addClass('show'); 3439 return; 3440 }); 3441 }); 3442 } 3443 }); 3444 $wrapper.mouseenter(function() { 3445 $(this).css({ 'padding-top' : paddingTop + 40, 'padding-bottom' : paddingBottom + 40 }); 3446 }); 3447 $wrapper.mouseleave(function() { 3448 $(this).css({ 'padding-top' : paddingTop, 'padding-bottom' : paddingBottom }); 3449 }); 3450 }); 3451 }, 3452 imageText: function(){ 3453 var $el = $('.eut-image-text.eut-layout-1'); 3454 if( !$el.length ) return; 3455 $el.each(function(){ 3456 var $that = $(this), 3457 $img = $that.find('img'), 3458 $cont = $that.find('.eut-content'); 3459 $img.css({ 'padding-top' : '', 'padding-bottom' : '' }); 3460 $cont.css({ 'padding-top' : '', 'padding-bottom' : '' }); 3461 $that.css('visibility','hidden'); 3462 $img.imagesLoaded( function() { 3463 var imgHeight = $img.height(), 3464 contHeight = $cont.height(), 3465 space = parseInt( (imgHeight - contHeight)/2 ); 3466 if( $(window).width() + scrollBarWidth >= mobileScreen ) { 3467 if( imgHeight < contHeight ){ 3468 space = parseInt( (contHeight - imgHeight)/2 ); 3469 $img.css({ 'padding-top' : space, 'padding-bottom' : space }); 3470 } else { 3471 $cont.css({ 'padding-top' : space, 'padding-bottom' : space }); 3472 } 3473 } 3474 $that.css('visibility','visible'); 3475 }); 3476 3477 }); 3478 }, 3479 imageTextParallax: function(){ 3480 var $el = $('.eut-image-text.eut-layout-2'), 3481 $paraller = $el.find('.eut-paraller'); 3482 3483 imagesLoaded( $el, function() { 3484 $paraller.paraller({ 3485 wrapper : '.eut-paraller-wrapper', 3486 invert : false, 3487 tabletL : [1200, true], 3488 tabletP : [1023, false], 3489 mobileL : [767, false] 3490 }); 3491 }); 3492 }, 3493 doubleImageText: function(){ 3494 var $el = $('.eut-double-image-text'), 3495 $paraller = $el.find('.eut-paraller'); 3496 3497 imagesLoaded( $el, function() { 3498 $paraller.paraller({ 3499 wrapper : '.eut-paraller-wrapper', 3500 invert : false, 3501 tabletL : [1200, true], 3502 tabletP : [1023, true], 3503 mobileL : [767, false] 3504 }); 3505 }); 3506 }, 3507 portfolioParallax: function(){ 3508 var $el = $('.eut-portfolio-fildisi-style'), 3509 $paraller = $el.find('.eut-paraller'); 3510 3511 imagesLoaded( $el, function() { 3512 $paraller.paraller({ 3513 wrapper : '.eut-paraller-wrapper', 3514 invert : false, 3515 tabletL : [1200, true], 3516 tabletP : [1023, true], 3517 mobileL : [767, false] 3518 }); 3519 }); 3520 }, 3521 teamParallax: function(){ 3522 var $el = $('.eut-team.eut-layout-2'), 3523 $paraller = $el.find('.eut-paraller'); 3524 3525 imagesLoaded( $el, function() { 3526 $paraller.paraller({ 3527 wrapper : '.eut-paraller-wrapper', 3528 invert : false, 3529 tabletL : [1200, true], 3530 tabletP : [1023, true], 3531 mobileL : [767, false] 3532 }); 3533 }); 3534 }, 3535 testimonialParallax: function(){ 3536 var $el = $('.eut-testimonial.eut-layout-2'), 3537 $paraller = $el.find('.eut-paraller'); 3538 3539 imagesLoaded( $el, function() { 3540 $paraller.paraller({ 3541 wrapper : '.eut-paraller-wrapper', 3542 invert : false, 3543 tabletL : [1200, true], 3544 tabletP : [1023, true], 3545 mobileL : [767, false] 3546 }); 3547 }); 3548 }, 3549 sliderParallax: function(){ 3550 var $el = $('.eut-content-slider.eut-layout-2'), 3551 $paraller = $el.find('.eut-paraller'); 3552 3553 imagesLoaded( $el, function() { 3554 $paraller.paraller({ 3555 wrapper : '.eut-paraller-wrapper', 3556 invert : false, 3557 tabletL : [1200, true], 3558 tabletP : [1023, true], 3559 mobileL : [767, false] 3560 }); 3561 }); 3562 }, 3563 iconBox: function(){ 3564 var $iconBox = $('.eut-box-icon.eut-advanced-hover'); 3565 if( isMobile.any() ) { 3566 $iconBox.css({'visibility' : 'visible'}); 3567 return false;
3568 } 3569 $iconBox.each(function(){ 3570 var $that = $(this), 3571 $text = $that.find('p'), 3572 $column = $that.parents('.eut-column'), 3573 space = 0, 3574 resize = false; 3575 3576 setup(); 3577 $(window).smartresize(setup); 3578 3579 function updateParams(){ 3580 space = $text.outerHeight(); 3581 } 3582 3583 function resetIcon(){ 3584 $that.css({ 'top' : '' }); 3585 $text.css({ 'opacity' : 1, 'bottom' : '' }); 3586 } 3587 3588 function setup(){ 3589 if(!resize){ 3590 resize = true; 3591 3592 resetIcon(); 3593 updateParams(); 3594 3595 $column.css({ 'overflow' : 'hidden' }); 3596 $that.css({ 'top' : space, 'visibility' : 'visible' }); 3597 $text.css({ 'opacity' : 0, 'position' : 'relative', 'bottom' : '-120%' }); 3598 3599 resize = true; 3600 } 3601 } 3602 3603 $column.mouseenter(function() { 3604 $that.stop( true, true ).animate({ 3605 'top' : 0 3606 },400, 'easeOutBack'); 3607 $text.stop( true, true ).delay( 100 ).animate({ 3608 'opacity' : 1, 3609 'bottom' : 0 3610 },600, 'easeOutBack'); 3611 }); 3612 $column.mouseleave(function() { 3613 $that.stop( true, true ).animate({ 3614 'top' : space 3615 },500, 'easeOutBack'); 3616 $text.stop( true, true ).animate({ 3617 'opacity' : 0, 3618 'bottom' : '-120%' 3619 },400, 'easeOutBack'); 3620 }); 3621 3622 function resize(){ 3623 var delay; 3624 window.clearTimeout(delay);
3625 delay = window.setTimeout(function() { 3626 setup(); 3627 }, 200); 3628 } 3629 3630 }); 3631 3632 }, 3633 messageBox: function(){ 3634 var infoMessage = $('.eut-message'), 3635 closeBtn = infoMessage.find($('.eut-close')); 3636 closeBtn.on('click',function(){ 3637 $(this).parent().slideUp(150); 3638 }); 3639 }, 3640 wooProduct: function(){ 3641 var $item = $('.eut-product-item'), 3642 $addBtn = $item.find('.add_to_cart_button'); 3643 $addBtn.on('click',function(){ 3644 $(this).parents('.eut-product-item').addClass('eut-product-added'); 3645 }); 3646 }, 3647 wooProductZoom: function(){ 3648 if( !isMobile.any() ){ 3649 if ( $('.eut-product-image.easyzoom').length ) { 3650 var $easyzoom = $('.eut-product-image.easyzoom').easyZoom(); 3651 var api = $easyzoom.data('easyZoom'); 3652 $( ".variations_form" ).on( 'woocommerce_variation_has_changed', function( event, variation ){ 3653 var imageZoom = $('.eut-product-image .woocommerce-main-image').attr('href'); 3654 var $productImg = $('.eut-product-image .woocommerce-main-image img'); 3655 var imageSrc = $productImg.attr('src'); 3656 api.swap( imageSrc , imageZoom ); 3657 } ); 3658 } 3659 } 3660 }, 3661 animAppear: function(){ 3662 if( bodyLoader || $('body').hasClass('page-template-template-full-page') ){ 3663 return; 3664 } 3665 if( isMobile.any() && !deviceAnimAppear ) { 3666 $('.eut-animated-item').css('opacity',1); 3667 } else { 3668 $('.eut-animated-item').each(function() { 3669 var $that = $(this), 3670 timeDelay = $that.attr('data-delay'); 3671 3672 $that.appear(function() { 3673 setTimeout(function () { 3674 $that.addClass('eut-animated'); 3675 }, timeDelay); 3676 },{accX: 0, accY: -150}); 3677 }); 3678 } 3679 }, 3680 htmlVideoPlayWhenAppear: function(){ 3681 var $video = $('.eut-embed-video'); 3682 $video.each(function(){ 3683 var $that = $(this); 3684 $that[0].pause(); 3685 $that.appear(function(){ 3686 if( $that[0].autoplay ){ 3687 $that[0].play(); 3688 } 3689 },{accX: 0, accY: -150}); 3690 }); 3691 }, 3692 accordionToggle: function(){ 3693 $('.eut-accordion-wrapper.eut-action-toggle li .eut-title-wrapper').on('click',function(){ 3694 var $that = $(this); 3695 $that 3696 .toggleClass('active') 3697 .next().slideToggle(350); 3698 if( $(this).parent().find('.eut-isotope').length ) { 3699 setTimeout(function(){ 3700 EUTHEM.isotope.init(); 3701 },100); 3702 } 3703 if( $(this).parent().find('.eut-blog-leader.eut-fildisi-style').length ) { 3704 EUTHEM.leaderPostSize.init(); 3705 } 3706 }); 3707 $('.eut-accordion-wrapper.eut-action-accordion li .eut-title-wrapper').on('click',function(){ 3708 var $that = $(this); 3709 $that 3710 .toggleClass('active').next().slideToggle(350) 3711 .parent().siblings().find('.eut-title-wrapper').removeClass('active') 3712 .next().slideUp(350); 3713 if( $(this).parent().find('.eut-isotope').length ) { 3714 setTimeout(function(){ 3715 EUTHEM.isotope.init(); 3716 },100); 3717 } 3718 if( $(this).parent().find('.eut-blog-leader.eut-fildisi-style').length ) { 3719 EUTHEM.leaderPostSize.init(); 3720 } 3721 }); 3722 }, 3723 tabs: function(){ 3724 $('.eut-tab-title').on('click',function(){ 3725 var $that = $(this), 3726 contentId = $that.data('rel'); 3727 $that.parents('.eut-tab').find('.eut-tab-title').removeClass('active'); 3728 $that.addClass('active'); 3729 $that.parents('.eut-tab').find('.eut-tab-content').removeClass('active'); 3730 $that.parents('.eut-tab').find(contentId).addClass('active'); 3731 if( $that.parents('.eut-tab').find('.eut-tab-content').find('.eut-isotope').length ) { 3732 setTimeout(function(){ 3733 EUTHEM.isotope.init(); 3734 },100); 3735 } 3736 if( $that.parents('.eut-tab').find('.eut-tab-content').find('.eut-blog-leader.eut-fildisi-style').length ) { 3737 EUTHEM.leaderPostSize.init(); 3738 } 3739 }); 3740 }, 3741 vcAccordion: function(){ 3742 var $target = $('.vc_tta-accordion').find('a[data-vc-accordion]'), 3743 $panel = $('.vc_tta-panel'); 3744 if( $panel.find('.eut-isotope').length ) { 3745 setTimeout(function(){ 3746 EUTHEM.isotope.init(); 3747 },100); 3748 } 3749 $target.on('click',function(){ 3750 if( $panel.find('.eut-isotope').length ) { 3751 setTimeout(function(){ 3752 EUTHEM.isotope.init(); 3753 },100); 3754 } 3755 }); 3756 }, 3757 vcTab: function(){ 3758 var $target = $('.vc_tta-tabs').find('a[data-vc-tabs]'), 3759 $panel = $('.vc_tta-panel'); 3760 if( $panel.find('.eut-isotope').length ) { 3761 setTimeout(function(){ 3762 EUTHEM.isotope.init(); 3763 },100); 3764 } 3765 $target.on('click',function(){ 3766 if( $panel.find('.eut-isotope').length ) { 3767 setTimeout(function(){ 3768 EUTHEM.isotope.init(); 3769 },100); 3770 } 3771 }); 3772 }, 3773 productSocials: function(){ 3774 var $socials = $('.eut-product-social'), 3775 $item = $socials.find('li'); 3776 if( !$socials.length ) return; 3777 3778 $socials.appear(function() { 3779 $item.each(function(i,n){ 3780 var $this = $(this); 3781 setTimeout(function(){ 3782 $this.addClass('eut-animated'); 3783 },150 * i); 3784 }); 3785 }
3785,{accX: 0, accY: -50}); 3786 }, 3787 countdown: function(){ 3788 $('.eut-countdown').each(function() { 3789 var $this = $(this), 3790 finalDate = $this.data('countdown'), 3791 numbersSize = $this.data('numbers-size'), 3792 textSize = $this.data('text-size'), 3793 numbersColor = $this.data('numbers-color'), 3794 textColor = $this.data('text-color'), 3795 countdownItems = '', 3796 text = '', 3797 countdownFormat = $this.data('countdown-format').split('|'); 3798 3799 $.each( countdownFormat, function( index, value ) { 3800 switch (value) { 3801 case 'w': 3802 text = fildisi_eutf_main_data.string_weeks; 3803 break; 3804 case 'D': 3805 case 'd': 3806 case 'n': 3807 text = fildisi_eutf_main_data.string_days; 3808 break; 3809 case 'H': 3810 text = fildisi_eutf_main_data.string_hours; 3811 break; 3812 case 'M': 3813 text = fildisi_eutf_main_data.string_minutes; 3814 break; 3815 case 'S': 3816 text = fildisi_eutf_main_data.string_seconds; 3817 break; 3818 default: 3819 text = ''; 3820 } 3821 countdownItems += '<div class="eut-countdown-item">'; 3822 countdownItems += '<div class="eut-number eut-' + numbersSize + ' eut-text-' + numbersColor + '">%' + value + '</div>'; 3823 countdownItems += '<span class="eut-' + textSize + ' eut-text-' + textColor + '">
3823' + text + '</span>'; 3824 countdownItems += '</div>'; 3825 3826 }); 3827 3828 $this.countdown(finalDate, function(event) { 3829 $this = $(this).html(event.strftime( countdownItems )); 3830 }); 3831 }); 3832 }, 3833 hovers: function(){ 3834 var $hoverItem = $('.eut-image-hover'); 3835 if( isMobile.any() && 0 == fildisi_eutf_main_data.device_hover_single_tap ) { 3836 var touchevent = 'touchend'; 3837 if( $hoverItem.parent().parent().hasClass('eut-carousel-item') ) { 3838 touchevent = 'touchstart'; 3839 } 3840 $hoverItem.on(touchevent, function(e) { 3841 var $item = $(this); 3842 if ( !$item.hasClass('hover') ) { 3843 $item.addClass('hover'); 3844 $hoverItem.not(this).removeClass('hover'); 3845 e.preventDefault(); 3846 } 3847 }); 3848 $(document).on('touchstart touchend', function(e) { 3849 if ( !$hoverItem.is(e.target) && $hoverItem.has(e.target).length === 0 ) { 3850 $hoverItem.removeClass('hover'); 3851 } 3852 }); 3853 } else { 3854 $hoverItem.off('click'); 3855 $hoverItem.off('mouseenter mouseleave').on('mouseenter mouseleave', function() { 3856 $(this).toggleClass('hover'); 3857 }); 3858 } 3859 } 3860 }; 3861 3862 // # Parallax Section 3863 // ============================================================================= // 3864 EUTHEM.parallaxSection = { 3865 init : function( section ){ 3866 var $section = $(section); 3867 imagesLoaded( $(section), function() { 3868 $(section).bgParallax(); 3869 }); 3870 } 3871 }; 3872 3873 // # Section Settings 3874 // ============================================================================= // 3875 EUTHEM.sectionSettings = { 3876 init: function(){ 3877 3878 if( !$('#eut-sidebar').length ) return; 3879 3880 var section = '#eut-content .eut-section', 3881 windowWidth = $(window).width(), 3882 themeWidth = $('#eut-theme-wrapper').width(), 3883 wrapperWidth = $('.eut-content-wrapper').width(), 3884 contentWidth = $('#eut-main-content').width(), 3885 sidebarWidth = $('#eut-sidebar').outerWidth(), 3886 space = (themeWidth - wrapperWidth)/2, 3887 sidebarSpace = space + wrapperWidth - contentWidth; 3888 3889 3890 $(section).each(function(){ 3891 var $section = $(this); 3892 if( $section.hasClass('eut-fullwidth-background') ){ 3893 fullBg($section); 3894 } 3895 if( $section.hasClass('eut-fullwidth') ){ 3896 fullElement($section); 3897 } 3898 3899 }); 3900 3901 function fullBg( section ) { 3902 if( windowWidth + scrollBarWidth >= tabletPortrait ) { 3903 if( $('.eut-right-sidebar').length ) { 3904 section.css({ 'visibility': 'visible', 'padding-left':space, 'padding-right': sidebarSpace, 'margin-left': -space, 'margin-right': -sidebarSpace}); 3905 } 3906 else { 3907 section.css({ 'visibility': 'visible', 'padding-left':sidebarSpace, 'padding-right': space, 'margin-left': -sidebarSpace, 'margin-right': -space}); 3908 } 3909 } else { 3910 section.css({ 'visibility': 'visible', 'padding-left':'', 'padding-right': '', 'margin-left': '', 'margin-right': ''}); 3911 } 3912 3913 } 3914 3915 function fullElement( section ) { 3916 if( windowWidth + scrollBarWidth >= tabletPortrait ) { 3917 if( $('.eut-right-sidebar').length ) { 3918 section.css({ 'visibility': 'visible', 'padding-left':0, 'padding-right': sidebarSpace, 'margin-left': -space, 'margin-right': -sidebarSpace}); 3919 } 3920 else { 3921 section.css({ 'visibility': 'visible', 'padding-left':sidebarSpace, 'padding-right': 0, 'margin-left': -sidebarSpace, 'margin-right': -space}); 3922 } 3923 } else { 3924 section.css({ 'visibility': 'visible', 'padding-left':'', 'padding-right': '', 'margin-left': -space, 'margin-right': -space}); 3925 } 3926 } 3927 } 3928 }; 3929 3930 // # Isotope 3931 // ============================================================================= // 3932 EUTHEM.isotope = { 3933 3934 init: function(){ 3935 var $selector = $('.eut-isotope'); 3936 if( !$selector.length ) return; 3937 $selector.each(function(){ 3938 var $element = $(this); 3939 EUTHEM.isotope.settings($element); 3940 }); 3941 3942 }, 3943 settings: function($element){ 3944 var $container = $element.find('.eut-isotope-container'), 3945 $curCategory = $element.find('.eut-current-category'), 3946 $isotopItem = $container.find('.eut-isotope-item'), 3947 layout = $element.data('layout') !== '' ? $element.data('layout') : 'fitRows', 3948 columnWidth = $element.hasClass('eut-portfolio') ? '.eut-image-square' : '', 3949 dataSpinner = $element.data('spinner'), 3950 gap = $element.hasClass('eut-with-gap') && !isNaN( $element.data('gutter-size') ) ? Math.abs( $element.data('gutter-size') )/2 : 0, 3951 isOriginLeft = $('body').hasClass('rtl') ? false : true; 3952 3953 var offset = $element.parents('.eut-section').hasClass('eut-fullwidth') ? -(gap * 2) : gap * 2, 3954 windowWidth = $(window).width() + scrollBarWidth, 3955 wrapperW, columns, columnW, containerW; 3956 3957 if( $element.hasClass('eut-with-gap') && $element.parents('.eut-section').hasClass('eut-fullwidth') ) { 3958 $element.css({'padding-left' : gap*2, 'padding-right' : gap*2 }); 3959 } 3960 3961 // Add Spinner 3962 if( dataSpinner == 'yes' ) { 3963 addSpinner(); 3964 } 3965 // Filters 3966 filter(); 3967 3968 var resizing = false, 3969 initIso = false, 3970 smallDelay; 3971 3972 updateParams( initIsotope ); 3973 3974 if( !isMobile.any() ) { 3975 $(window).smartresize(updateParams); 3976 } else { 3977 $(window).on("orientationchange",function(){ 3978 setTimeout(updateParams, 100); 3979 }); 3980 } 3981 3982 $('.eut-modal-popup').on( "eut_relayout_isotope", function() { 3983 updateParams(); 3984 }); 3985 3986 function updateParams(callback){ 3987 if( !resizing ) { 3988 resizing = true; 3989 windowWidth = $(window).width() + scrollBarWidth; 3990 wrapperW = $element.innerWidth() -2; 3991 columns = setColumns(); 3992 columnW = ( wrapperW + offset ) / columns; 3993 columnW = (columnW % 1 !== 0) ? Math.ceil(columnW) : columnW; 3994 containerW = columnW * columns; 3995 3996 itemSize(); 3997 containerSize(); 3998 if( callback && !initIso ) callback(); 3999 4000 if( initIso ) { 4001 window.clearTimeout(smallDelay);
4002 smallDelay = window.setTimeout( function(){ 4003 // Equal Columns 4004 if( layout === 'fitRows' && gridEqual ) { 4005 gridEqualColumns(); 4006 } 4007 if( $container.parents('.eut-section').hasClass('eut-custom-height') ){ 4008 $container.parents('.eut-section').data('plugin_columnSize').reCalculate(); 4009 } 4010 }, 200 ); 4011 } 4012 4013 $container.isotope('layout'); 4014 resizing = false; 4015 } 4016 } 4017 4018 function setColumns(){ 4019 var columns = { 4020 largeS : $element.data('columns-large-screen'), 4021 desktop : $element.data('columns'), 4022 tabletL : $element.data('columns-tablet-landscape'), 4023 tabletP : $element.data('columns-tablet-portrait'), 4024 mobile : $element.data('columns-mobile') 4025 }; 4026 $element.removeClass('eut-isotope-column-5 eut-isotope-column-4 eut-isotope-column-3 eut-isotope-column-2 eut-isotope-column-1'); 4027 if ( windowWidth > largeScreen ) { 4028 columns = columns.largeS; 4029 } else if ( windowWidth > tabletLandscape && windowWidth <= largeScreen ) { 4030 columns = columns.desktop; 4031 } else if ( windowWidth > tabletPortrait && windowWidth <= tabletLandscape ) { 4032 columns = columns.tabletL; 4033 } else if ( windowWidth > mobileScreen && windowWidth <= tabletPortrait ) { 4034 columns = columns.tabletP; 4035 } else { 4036 columns = columns.mobile; 4037 } 4038 4039 $element.addClass('eut-isotope-column-' + columns); 4040 return columns; 4041 } 4042 4043 function itemSize(){ 4044 4045 $isotopItem.css({ 'padding-left' : gap, 'padding-right' : gap, 'margin-bottom' : gap * 2, 'width' : columnW }); 4046 // Item Width * 2 4047 if( columns != 1 ) { 4048 $container.find('.eut-image-landscape').css({ 'width': columnW * 2 }).find('.eut-media').css({ 'height': columnW - ( gap * 2 ) }); 4049 $container.find('.eut-image-portrait').css({ 'width': columnW }).find('.eut-media').css({ 'height': ( columnW * 2 ) - ( gap * 2 ) }); 4050 } 4051 4052 // Item Column 2 4053 if( columns == 2 ) { 4054 if( windowWidth > mobileScreen ){ 4055 $container.find('.eut-image-landscape').css({ 'width': columnW }).find('.eut-media').css({ 'height': ( columnW / 2 ) - ( gap * 2 ) }); 4056 } else { 4057 $container.find('.eut-image-landscape').css({ 'width': columnW }).find('.eut-media').css({ 'height': columnW - ( gap * 2 ) }); 4058 } 4059 } 4060 4061 // Item Column 1 4062 if( columns == 1 ) { 4063 $container.find('.eut-image-landscape').css({ 'width': columnW }).find('.eut-media').css({ 'height': '' }); 4064 $container.find('.eut-image-portrait').css({ 'width': columnW }).find('.eut-media').css({ 'height': '' }); 4065 } 4066 } 4067 4068 function containerSize(){ 4069 $container.css({'margin-left' : - gap, 'margin-right' : - gap, 'width' : containerW }); 4070 } 4071 4072 function initIsotope(){ 4073 $container.isotope({ 4074 itemSelector: '.eut-isotope-item', 4075 layoutMode: layout, 4076 animationEngine : 'jquery', 4077 masonry: { 4078 columnWidth: columnWidth 4079 }, 4080 resize: false, 4081 isOriginLeft: isOriginLeft 4082 }); 4083 // layout Isotope after each image loads 4084 $container.imagesLoaded('always',function(){ 4085 $container.isotope('layout'); 4086 // Spinner 4087 var dataSpinner = $container.parent().data('spinner'); 4088 if( dataSpinner == 'yes' ) { 4089 setTimeout(function() { 4090 removeSpinner(); 4091 },2000); 4092 } else { 4093 $container.css({'opacity': 1}); 4094 // Isotope Animation 4095 if( !isMobile.any() ){ 4096 animation($container); 4097 } else { 4098 $container.find('.eut-isotope-item-inner').addClass('eut-animated'); 4099 } 4100 } 4101 }); 4102 4103 initIso = true; 4104 } 4105 4106 function addSpinner(){
4107 var $spinner = $('<div class="eut-spinner"></div>'); 4108 $spinner.appendTo( $element ); 4109 } 4110 4111 function removeSpinner(){ 4112 $element.find('.eut-spinner').fadeOut(600,function(){ 4113 $container.css({'opacity': 1}); 4114 animation(); 4115 }); 4116 } 4117 4118 function animation(){ 4119 var cnt = 1, 4120 itemAppeared = 1; 4121 $isotopItem.appear(function() { 4122 var $this = $(this), 4123 delay = 200 * cnt++; 4124 4125 setTimeout(function () { 4126 itemAppeared++; 4127 if( itemAppeared == cnt ){ 4128 cnt = 1; 4129 } 4130 $this.find('.eut-isotope-item-inner').addClass('eut-animated'); 4131 }, delay); 4132 }); 4133 } 4134 4135 function filter(){ 4136 $element.find('.eut-filter li').on('click',function(){ 4137 var $filter = $(this), 4138 selector = $filter.attr('data-filter'), 4139 title = $filter.html(), 4140 $curCategory = $element.find('.eut-current-category'); 4141 4142 if( $curCategory.length > 0 ){ 4143 $curCategory.find('span').html( title ); 4144 } 4145 4146 $container.isotope({ 4147 filter: selector 4148 }); 4149 4150 // Go to top 4151 EUTHEM.pageSettings.linkGoToTop( $filter.parent(), 300, 30 ); 4152 4153 $(this).addClass('selected').siblings().removeClass('selected'); 4154 }); 4155 } 4156 4157 function gridEqualColumns(){ 4158 var $elContent = $container.find('.eut-blog-item-inner'), 4159 heightArr = [], 4160 columnMaxH = 0; 4161 4162 // Reset Height 4163 $container.find('.eut-isotope-item .eut-post-content').css('height','auto'); 4164 $container.find('.eut-isotope-item .eut-blog-item-inner').css('height','auto'); 4165 $container.find('.eut-isotope-item .eut-post-meta-wrapper').removeClass('eut-bottom'); 4166 4167 $elContent.each(function(){ 4168 var $that = $(this), 4169 height = $that.outerHeight(); 4170 heightArr.push( height ); 4171 }); 4172 4173 columnMaxH = heightArr.length > 0 ? Math.max.apply(Math, heightArr) : 0; 4174 4175 $container.find('.eut-isotope-item .eut-blog-item-inner').css('height',columnMaxH); 4176 $container.find('.eut-isotope-item .eut-post-meta-wrapper').addClass('eut-bottom'); 4177 $container.find('.eut-isotope-item.eut-style-2').addClass('eut-middle'); 4178 4179 $container.isotope('layout'); 4180 } 4181 }, 4182 noIsoFilters: function() { 4183 var $selector = $('.eut-non-isotope'); 4184 $selector.each(function(){ 4185 var $that = $(this); 4186 $that.find('.eut-filter li').on('click',function(){ 4187 var selector = $(this).attr('data-filter'); 4188 if ( '*' == selector ) { 4189 $that.find('.eut-non-isotope-item').fadeIn('1000'); 4190 } else { 4191 $that.find('.eut-non-isotope-item').hide(); 4192 $that.find(selector).fadeIn('1000'); 4193 } 4194 $(this).addClass('selected').siblings().removeClass('selected'); 4195 }); 4196 }); 4197 } 4198 }; 4199 4200 // # Social Bar For Post 4201 // ============================================================================= // 4202 EUTHEM.socialBar = { 4203 init : function(){ 4204 var $bar = $('#eut-socials-bar'); 4205 if( !$bar.length ) { 4206 return; 4207 } 4208 if( isMobile.any() ) { 4209 $bar.addClass('eut-no-animation'); 4210 return; 4211 } 4212 var posTop = $bar.offset().top, 4213 scroll = $(window).scrollTop(), 4214 windowHeight = $(window).height(), 4215 offset = ( $bar.offset().top - windowHeight ) + 50; 4216 4217 if( scroll > offset ) { 4218 this.showSocials(); 4219 } else { 4220 this.hideSocials(); 4221 } 4222 }, 4223 showSocials : function(){ 4224 var $item = $('#eut-socials-bar').find('ul.eut-socials li a'), 4225 i = 0; 4226 $item.each(function(){ 4227 var $that = $(this); 4228 i++; 4229 setTimeout(function () { 4230 $that.addClass('show'); 4231 }, i * 200 ); 4232 }); 4233 }, 4234 hideSocials : function(){ 4235 var $item = $('#eut-socials-bar').find('ul.eut-socials li a'); 4236 $item.removeClass('show'); 4237 } 4238 }; 4239 4240 4241 // # Scroll Direction 4242 // ============================================================================= // 4243 EUTHEM.scrollDir = { 4244 init: function(){ 4245 var scroll = $(window).scrollTop(); 4246 if (scroll > lastScrollTop){ 4247 lastScrollTop = scroll; 4248 return { direction : 'scrollDown' }; 4249 } else { 4250 lastScrollTop = scroll; 4251 return { direction : 'scrollUp' }; 4252 } 4253 4254 lastScrollTop = scroll; 4255 } 4256 }; 4257 4258 // # Full Page 4259 // ============================================================================= // 4260 EUTHEM.fullPage = { 4261 init: function(){ 4262 var $fPage = $('#eut-fullpage'); 4263 if( !$fPage.length ) return; 4264 var $section = $fPage.find('.eut-row-section'); 4265 var deviceNavigation = true; 4266 var deviceAutoScrolling = true; 4267 var scrollOverflow = true; 4268 var fitToSection = true; 4269 var speed = $fPage.data('scroll-speed'); 4270 var deviceFullPageEnable = $fPage.data('device-scrolling') == 'yes' ? true : false;
4271 var lockAnchors = $fPage.data('lock-anchors') == 'yes' ? true : false; 4272 var loop = $fPage.data('scroll-loop'); 4273 var loopTop = false; 4274 var loopBottom = false; 4275 if ( 'both' == loop || 'top' == loop ) { 4276 loopTop = true; 4277 } 4278 if ( 'both' == loop || 'bottom' == loop ) { 4279 loopBottom = true; 4280 } 4281 4282 if( isMobile.any() && !deviceFullPageEnable ) { 4283 deviceNavigation = false; 4284 deviceAutoScrolling = false; 4285 scrollOverflow = false; 4286 fitToSection = false; 4287 $section.find('.eut-animated-item').addClass('eut-animated'); 4288 } 4289 4290 var navigationAnchorTooltips = $('[data-anchor-tooltip]').map(function(){ 4291 return $(this).data('anchor-tooltip').toString(); 4292 }).get(); 4293 4294 $fPage.fullpage({ 4295 navigation: deviceNavigation, 4296 navigationPosition: 'right', 4297 navigationTooltips: navigationAnchorTooltips, 4298 sectionSelector: $section, 4299 css3: true, 4300 scrollingSpeed: speed, 4301 autoScrolling : deviceAutoScrolling, 4302 fitToSection : fitToSection, 4303 lockAnchors : lockAnchors, 4304 loopTop : loopTop, 4305 loopBottom : loopBottom, 4306 scrollOverflow: scrollOverflow, 4307 afterLoad: function(anchorLink, index){ 4308 4309 var sectionHeaderColor = $($section[index-1]).attr('data-header-color'); 4310 var color = 'eut-' + sectionHeaderColor; 4311 4312 $section.find('.fp-tableCell').css('visibility','visible'); 4313 4314 // Set Header Color 4315 if( !$('#eut-main-header').hasClass('eut-header-side') ) { 4316 $('#eut-main-header').removeClass('eut-light eut-dark').addClass(color); 4317 } 4318 $('#fp-nav').removeClass('eut-light eut-dark').addClass(color); 4319 4320 EUTHEM.scrollingPageAnimations.addAnim( $section, index ); 4321 }, 4322 afterRender: function(){ 4323 $('.eut-bg-video').each(function(){ 4324 var $that = $(this), 4325 $video = $that.find('video'); 4326 if( $video.length ){ 4327 $video[0].play(); 4328 } 4329 EUTHEM.pageSettings.resizeVideoBgElement( $that ); 4330 }); 4331 4332 }, 4333 onLeave: function(index){ 4334 if( !isMobile.any() ) { 4335 EUTHEM.scrollingPageAnimations.removeAnim( $section, index, speed ); 4336 } 4337 } 4338 }); 4339 } 4340 }; 4341 4342 // # Pilling Page 4343 // ============================================================================= // 4344 EUTHEM.pillingPage = { 4345 init: function(){ 4346 var $fPage = $('#eut-pilling-page'); 4347 if( !$fPage.length ) return; 4348 var $section = $fPage.find('.eut-row-section'); 4349 var deviceFullPageEnable = $fPage.data('device-scrolling') == 'yes' ? true : false; 4350 var lockAnchors = $fPage.data('lock-anchors') == 'yes' ? true : false; 4351 var direction = $fPage.data('scroll-direction'); 4352 var loop = $fPage.data('scroll-loop'); 4353 var speed = $fPage.data('scroll-speed'); 4354 var loopTop = false; 4355 var loopBottom = false; 4356 if ( 'both' == loop || 'top' == loop ) { 4357 loopTop = true; 4358 } 4359 if ( 'both' == loop || 'bottom' == loop ) { 4360 loopBottom = true; 4361 } 4362 4363 if( isMobile.any() && !deviceFullPageEnable ) { 4364 $fPage.addClass('eut-disable-on-device'); 4365 $section.find('.eut-animated-item').addClass('eut-animated'); 4366 $section.children().wrap('<div class="pp-tableCell"></div>'); 4367 $('.eut-row-section').each(function(){ 4368 if ( $(this).attr('data-anchor').length ) { 4369 $(this).attr('id', $(this).attr('data-anchor') ); 4370 } 4371 }); 4372 return; 4373 } 4374 4375 var navigationAnchorTooltips = $('[data-anchor-tooltip]').map(function(){ 4376 return $(this).data('anchor-tooltip').toString(); 4377 }).get(); 4378 4379 4380 var navigationAnchors = []; 4381 if ( !lockAnchors ) { 4382 navigationAnchors = $('[data-anchor]').map(function(){ 4383 return $(this).data('anchor').toString(); 4384 }).get(); 4385 } 4386 4387 $('html').addClass('fp-enabled'); 4388 4389 $fPage.pagepiling({ 4390 sectionSelector: $section, 4391 css3: true, 4392 scrollingSpeed: speed, 4393 anchors: navigationAnchors, 4394 direction: direction, 4395 lockAnchors : lockAnchors, 4396 loopTop : loopTop, 4397 loopBottom : loopBottom, 4398 navigation: { 4399 'tooltips': navigationAnchorTooltips 4400 }, 4401 afterLoad: function(anchorLink, index){ 4402 4403 var sectionHeaderColor = $($section[index-1]).attr('data-header-color'); 4404 var color = 'eut-' + sectionHeaderColor; 4405 // Set Header Color 4406 if( !$('#eut-main-header').hasClass('eut-header-side') ) { 4407 $('#eut-main-header').removeClass('eut-light eut-dark').addClass(color); 4408 } 4409 $('#pp-nav').removeClass('eut-light eut-dark').addClass(color); 4410 4411 EUTHEM.scrollingPageAnimations.addAnim( $section, index ); 4412 }, 4413 afterRender: function(){ 4414 var sectionHeaderColor = $($section[0]).attr('data-header-color'); 4415 var color = 'eut-' + sectionHeaderColor; 4416 4417 $('.eut-bg-video').each(function(){ 4418 var $that = $(this), 4419 $video = $that.find('video'); 4420 if( $video.length ){ 4421 $video[0].play(); 4422 } 4423 EUTHEM.pageSettings.resizeVideoBgElement( $that ); 4424 }); 4425 // Set Header Color 4426 if( !$('#eut-main-header').hasClass('eut-header-side') ) { 4427 $('#eut-main-header').removeClass('eut-light eut-dark').addClass(color); 4428 } 4429 $('#pp-nav').removeClass('eut-light eut-dark').addClass(color); 4430 EUTHEM.scrollingPageAnimations.addAnim( $section, 1 ); 4431 }, 4432 onLeave: function(index){ 4433 EUTHEM.scrollingPageAnimations.removeAnim( $section, index, speed ); 4434 } 4435 }); 4436 } 4437 }; 4438 4439 // # Scrolling Page Animations 4440 // ============================================================================= // 4441 EUTHEM.scrollingPageAnimations = { 4442 addAnim: function( section, index ){ 4443 var $section = $(section[index-1]), 4444 $element = $section.find('.eut-animated-item'); 4445 4446 $element.each(function(){ 4447 var $that = $(this),
4448 delay = $that.data('delay'); 4449 setTimeout(function(){ 4450 $that.addClass('eut-animated'); 4451 },delay); 4452 }); 4453 }, 4454 removeAnim: function(section, index, speed){ 4455 var $section = $(section[index-1]), 4456 $element = $section.find('.eut-animated-item'); 4457 setTimeout(function(){ 4458 $element.removeClass('eut-animated'); 4459 },speed); 4460 } 4461 }; 4462 4463 // # Section Navigation 4464 // ============================================================================= // 4465 EUTHEM.sectionNav = { 4466 init: function(){ 4467 4468 var $content = $('#eut-content'); 4469 4470 // Check if content has class section-nav 4471 if( !$content.hasClass('eut-section-nav') ) return; 4472 4473 var $themeWrapper = $('#eut-theme-wrapper'); 4474 var $section = $('.eut-section[data-anchor]'); 4475 var anchor; 4476 4477 // Create Navigation List 4478 createList(); 4479 4480 var $navigation = $('#eut-section-nav'); 4481 var $navItem = $('#eut-section-nav .eut-nav-item'); 4482 var animate = false; 4483 4484 // On Click Navigation Item 4485 $navItem.on('click', function(event){ 4486 event.preventDefault(); 4487 var $that = $(this); 4488 var link = $that.attr('href'); 4489 var scrollTop = Math.abs($(window).scrollTop()) / 2; 4490 var speed = scrollTop < 1000 ? 1000 : scrollTop; 4491 var $target = $('.eut-section[data-anchor=' + link + ']'); 4492 var headerHeight = $('#eut-header').data('sticky') != 'none' ? $('#eut-header').data('sticky-height') : 0; 4493 var targetTop = $target.offset().top - headerHeight + 1; 4494 4495 $that.addClass('active').siblings().removeClass('active'); 4496 4497 smoothScroll( targetTop, speed ); 4498 4499 }); 4500 4501 updateNav(); 4502 $(window).on('scroll', function(){ 4503 if( !animate ){ 4504 updateNav(); 4505 } 4506 }); 4507 4508 function createList(){ 4509 $('<div id="eut-section-nav"><div class="eut-inner-nav"></div></div>').appendTo($themeWrapper); 4510 $section.each(function(){ 4511 var $that = $(this); 4512 var title = $that.data('anchor-tooltip'); 4513 anchor = $that.data('anchor'); 4514 var $listEl = $('<a class="eut-nav-item eut-small-text" href="' + anchor + '">' + title + '</a>'); 4515 if( title ) { 4516 $listEl.prependTo( $('#eut-section-nav .eut-inner-nav') ); 4517 } 4518 }); 4519 } 4520 4521 function updateNav(){ 4522 $section.each(function(){ 4523 var $that = $(this); 4524 if ( ( $that.offset().top - $(window).height()/2 < $(window).scrollTop() ) && ( $that.offset().top + $that.outerHeight() - $(window).height()/2 > $(window).scrollTop() ) ) { 4525 $navigation.find('a[href=' + $that.data('anchor') + ']').addClass('active'); 4526 } else { 4527 $navigation.find('a[href=' + $that.data('anchor') + ']').removeClass('active'); 4528 } 4529 }); 4530 } 4531 4532 function smoothScroll(target, speed){ 4533 if( !animate ) { 4534 animate = true; 4535 $('html, body').animate({scrollTop: target}, speed, 'easeInOutCubic',function(){ 4536 animate = false; 4537 }); 4538 $("html, body").on("scroll mousedown DOMMouseScroll mousewheel keyup", function(){ 4539 $('html, body').stop(); 4540 animate = false; 4541 }); 4542 } 4543 } 4544 } 4545 }; 4546 4547 // # Global Variables 4548 // ============================================================================= // 4549 var bodyLoader = false;
4550 var largeScreen = 2048; 4551 var tabletLandscape = 1200; 4552 var tabletPortrait = 1023; 4553 var mobileScreen = 767; 4554 var lastScrollTop = 0; 4555 var wpBarHeight = $('.eut-body').hasClass('admin-bar') ? 32 : 0; 4556 var $videoBg = $('.eut-bg-video'); 4557 var isMobile = { 4558 Android: function() { 4559 return navigator.userAgent.match(/Android/i); 4560 }, 4561 BlackBerry: function() { 4562 return navigator.userAgent.match(/BlackBerry/i); 4563 }, 4564 iOS: function() { 4565 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 4566 }, 4567 Opera: function() { 4568 return navigator.userAgent.match(/Opera Mini/i); 4569 }, 4570 Windows: function() { 4571 return navigator.userAgent.match(/IEMobile/i); 4572 }, 4573 any: function() { 4574 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 4575 } 4576 }; 4577 4578 // Animation support & prefixing 4579 var t = document.body || document.documentElement; 4580 var s = t.style; 4581 var tSupport = s.transition !== undefined || s.WebkitTransition !== undefined || s.MozTransition !== undefined || s.MsTransition !== undefined || s.OTransition !== undefined; 4582 var property = [ 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]; 4583 var prefix; 4584 for( var i in property ){ 4585 if( s[ property[ i ] ] !== undefined ){ 4586 prefix = '-' + property[ i ].replace( 'Transform', '' ).toLowerCase(); 4587 } 4588 } 4589 var transform = prefix + '-transform'; 4590 4591 // # Scrollbar Width 4592 // ============================================================================= // 4593 var parent, child, scrollBarWidth; 4594 4595 if( scrollBarWidth === undefined ) { 4596 parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'); 4597 child = parent.children(); 4598 scrollBarWidth = child.innerWidth()-child.height(99).innerWidth(); 4599 parent.remove(); 4600 } 4601 4602 4603 4604 $(document).ready(function(){ EUTHEM.documentReady.init(); }); 4605 $(window).smartresize(function(){ EUTHEM.documentResize.init(); }); 4606 $(window).on('load',function () { EUTHEM.documentLoad.init(); }); 4607 $(window).on('scroll', function() { EUTHEM.documentScroll.init(); }); 4608 4609})(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.