1/* ================================= 2 3 LOADER 4 5 =================================== */ 6 7// makes sure the whole site is loaded 8jQuery( window ).load( 9 function() { 10 11 // will first fade out the loading animation 12 jQuery( '.status' ).fadeOut(); 13 14 // will fade out the whole DIV that covers the website. 15 jQuery( '.preloader' ).delay( 1000 ).fadeOut( 'slow' ); 16 17 jQuery( '.carousel' ).carousel( 'pause' ); 18 19 // Focus styles for menus. 20 jQuery( '.navbar-collapse' ).find( 'a' ).on( 21 'focus blur', function() { 22 jQuery( this ).parents().toggleClass( 'link-focus' ); 23 } 24 ); 25 26 jQuery( '.carousel-control' ).click( 27 function() { 28 this.blur(); 29 } 30 ); 31 32 } 33); 34 35/*** DROPDOWN FOR MOBILE MENU */ 36var callback_mobile_dropdown = function () { 37 38 if ( jQuery( '.wr-megamenu-container' ).length <= 0 && jQuery( '.mega-menu-wrap' ).length <= 0 ) { 39 var navLi = jQuery( '#site-navigation li' ); 40 navLi.each( 41 function(){ 42 if ( jQuery( this ).find( 'ul' ).length > 0 && ! jQuery( this ).hasClass( 'has_children' ) ) { 43 jQuery( this ).addClass( 'has_children' ); 44 jQuery( this ).find( 'a' ).first().after( '<p class="dropdownmenu"></p>' ); 45 } 46 } 47 ); 48 jQuery( '.dropdownmenu' ).click( 49 function(){ 50 if ( jQuery( this ).parent( 'li' ).hasClass( 'this-open' ) ) { 51 jQuery( this ).parent( 'li' ).removeClass( 'this-open' ); 52 } else { 53 jQuery( this ).parent( 'li' ).addClass( 'this-open' ); 54 } 55 } 56 ); 57 navLi.find( 'a' ).click( 58 function(){ 59 jQuery( '.navbar-toggle' ).addClass( 'collapsed' ); 60 jQuery( '#site-navigation .collapse' ).removeClass( 'in' ); 61 } 62 ); 63 } 64 65}; 66jQuery( document ).ready( callback_mobile_dropdown ); 67 68jQuery( document ).ready( 69 function() { 70 var current_height = parseInt( jQuery( '.header .container' ).height() ); 71 jQuery( '.header' ).css( 'min-height', current_height); 72 } 73); 74 75 76/* show/hide reCaptcha */ 77jQuery( document ).ready( 78 function() { 79 80 var thisOpen = false; 81 jQuery( '.contact-form .form-control' ).each( 82 function(){ 83 if ( jQuery( this ).val().length > 0 ) { 84 thisOpen = true; 85 jQuery( '.zerif-g-recaptcha' ).css( 'display','block' ).delay( 1000 ).css( 'opacity','1' ); 86 return false; 87 } 88 } 89 ); 90 if ( thisOpen === false && (typeof jQuery( '.contact-form textarea' ) !== 'undefined') && (jQuery( '.contact-form textarea' ).length > 0) && (typeof jQuery( '.contact-form textarea' ).val() !== 'undefined') && (jQuery( '.contact-form textarea' ).val().length > 0) ) { 91 thisOpen = true; 92 jQuery( '.zerif-g-recaptcha' ).css( 'display','block' ).delay( 1000 ).css( 'opacity','1' ); 93 } 94 jQuery( '.contact-form input, .contact-form textarea' ).focus( 95 function(){ 96 if ( ! jQuery( '.zerif-g-recaptcha' ).hasClass( 'recaptcha-display' ) ) { 97 jQuery( '.zerif-g-recaptcha' ).css( 'display','block' ).delay( 1000 ).css( 'opacity','1' ); 98 } 99 } 100 ); 101 102 } 103); 104 105/* ================================= 106 107 === Bootstrap Fix ==== 108 109 =================================== */ 110 111if (navigator.userAgent.match( /IEMobile\/10\.0/ )) { 112 113 var msViewportStyle = document.createElement( 'style' ); 114 115 msViewportStyle.appendChild( 116 117 document.createTextNode( 118 119 '@-ms-viewport{width:auto!important}' 120 ) 121 ); 122 123 document.querySelector( 'head' ).appendChild( msViewportStyle ); 124 125} 126 127/* ================================= 128 129 === STICKY NAV ==== 130 131 =================================== */ 132 133jQuery( document ).ready( 134 function() { 135 136 // Sticky Header - http://jqueryfordesigners.com/fixed-floating-elements/ 137 if ( typeof jQuery( '#main-nav' ) !== 'undefined' && typeof jQuery( '#main-nav' ).offset() !== 'undefined' ) { 138 var top = jQuery( '#main-nav' ).offset().top - parseFloat( jQuery( '#main-nav' ).css( 'margin-top' ).replace( /auto/, 0 ) ); 139 } 140 141 jQuery( window ).scroll( 142 function () { 143 144 // what the y position of the scroll is 145 var y = jQuery( this ).scrollTop(); 146 147 // whether that's below the form 148 if (y >= top) { 149 150 // if so, ad the fixed class 151 jQuery( '#main-nav' ).addClass( 'fixed' ); 152 153 } else { 154 155 // otherwise remove it 156 jQuery( '#main-nav' ).removeClass( 'fixed' ); 157 158 } 159 160 } 161 ); 162 163 } 164); 165 166 167/*================================= 168 169 === SMOOTH SCROLL ==== 170 171 =================================== */ 172 173jQuery( window ).load( 174 function(){ 175 jQuery( '#site-navigation a[href*="#"]:not([href="#"]), header.header a[href*="#"]:not([href="#"]), #focus .focus-box .service-icon a[href*="#"]:not([href="#"])' ).bind( 176 'click',function () { 177 var headerHeight; 178 var navigationHeight; 179 var hash = this.hash; 180 var idName = hash.substring( 1 ); // get id name 181 var alink = this; // this button pressed 182 // check if there is a section that had same id as the button pressed 183 if ( jQuery( 'section [id*=' + idName + ']' ).length > 0 && jQuery( window ).width() >= 751 ) { 184 jQuery( '#site-navigation .current' ).removeClass( 'current' ); 185 jQuery( alink ).parent( 'li' ).addClass( 'current' ); 186 } else { 187 jQuery( '#site-navigation .current' ).removeClass( 'current' ); 188 } 189 if ( jQuery( window ).width() >= 751 ) { 190 headerHeight = jQuery( '#main-nav' ).height(); 191 navigationHeight = 0; 192 } else { 193 headerHeight = 0; 194 navigationHeight = jQuery( '#site-navigation' ).height() + jQuery( '#mega-menu-wrap-primary' ).height(); 195 } 196 if (location.pathname.replace( /^\//,'' ) === this.pathname.replace( /^\//,'' ) && location.hostname === this.hostname) { 197 var target = jQuery( this.hash ); 198 target = target.length ? target : jQuery( '[name=' + this.hash.slice( 1 ) + ']' ); 199 if (target.length) { 200 jQuery( 'html,body' ).animate( 201 { 202 scrollTop: target.offset().top - headerHeight - navigationHeight + 10 203 }, 1200 204 ); 205 206 // Close dropdown menu on mobile, after an anchor is clicked 207 if ( jQuery( '.navbar .navbar-collapse' ).hasClass( 'in' ) ) { 208 jQuery( '.navbar .navbar-collapse.in' ).removeClass( 'in' ); 209 } 210 if ( jQuery( '.navbar li.dropdown' ).hasClass( 'open' ) ) { 211 jQuery( '.navbar li.dropdown.open' ).removeClass( 'open' ); 212 } 213 if ( jQuery( '.mega-menu-toggle' ).hasClass( 'mega-menu-open' ) ) { 214 jQuery( '.mega-menu-toggle.mega-menu-open' ).removeClass( 'mega-menu-open' ); 215 } 216 217 return false;
218 } 219 } 220 } 221 ); 222 } 223); 224 225jQuery( document ).ready( 226 function(){ 227 var headerHeight; 228 var navigationHeight; 229 jQuery( '#site-navigation .current' ).removeClass( 'current' ); 230 jQuery( '#site-navigation a[href$="' + window.location.hash + '"]' ).parent( 'li' ).addClass( 'current' ); 231 if ( jQuery( window ).width() >= 751 ) { 232 headerHeight = jQuery( '#main-nav' ).height(); 233 navigationHeight = 0; 234 } else { 235 headerHeight = 0; 236 navigationHeight = jQuery( '#site-navigation' ).height() + jQuery( '#mega-menu-wrap-primary' ).height(); 237 } 238 if (location.pathname.replace( /^\//,'' ) === window.location.pathname.replace( /^\//,'' ) && location.hostname === window.location.hostname) { 239 var target = jQuery( window.location.hash ); 240 if (target.length) { 241 jQuery( 'html,body' ).animate( 242 { 243 scrollTop: target.offset().top - headerHeight - navigationHeight + 10 244 }, 1200 245 ); 246 return false; 247 } 248 } 249 } 250); 251 252/* TOP NAVIGATION MENU SELECTED ITEMS */ 253 254function zerif_lite_scrolled() { 255 256 if ( jQuery( window ).width() >= 751 ) { 257 258 var zerif_scrollTop = jQuery( window ).scrollTop(); // cursor position 259 var headerHeight = jQuery( '#main-nav' ).outerHeight(); // header height 260 var isInOneSection = 'no'; // used for checking if the cursor is in one section or not 261 262 // for all sections check if the cursor is inside a section 263 jQuery( 'section, header' ).each( 264 function() { 265 var thisID = '#' + jQuery( this ).attr( 'id' ); // section id 266 var zerif_offset = jQuery( this ).offset().top; // distance between top and our section 267 var thisHeight = jQuery( this ).outerHeight(); // section height 268 var thisBegin = zerif_offset - headerHeight; // where the section begins 269 var thisEnd = zerif_offset + thisHeight - headerHeight; // where the section ends 270 271 // if position of the cursor is inside of the this section 272 if ( zerif_scrollTop >= thisBegin && zerif_scrollTop <= thisEnd ) { 273 isInOneSection = 'yes'; 274 jQuery( '#site-navigation .current' ).removeClass( 'current' ); 275 jQuery( '#site-navigation a[href$="' + thisID + '"]' ).parent( 'li' ).addClass( 'current' ); // find the menu button with the same ID section 276 return false; 277 } 278 if (isInOneSection === 'no') { 279 jQuery( '#site-navigation .current' ).removeClass( 'current' ); 280 } 281 } 282 ); 283 } 284} 285jQuery( window ).on( 'scroll',zerif_lite_scrolled ); 286 287jQuery( document ).ready( 288 function(){ 289 290 var jQuerywindow = jQuery( window ); 291 292 jQuery( 'div[data-type="background"], header[data-type="background"], section[data-type="background"]' ).each( 293 function(){ 294 295 var jQuerybgobj = jQuery( this ); 296 297 jQuery( window ).scroll( 298 function() { 299 300 var yPos = -(jQuerywindow.scrollTop() / jQuerybgobj.data( 'speed' )); 301 302 var coords = '50% ' + yPos + 'px'; 303 304 jQuerybgobj.css( 305 { 306 307 backgroundPosition: coords 308 309 } 310 ); 311 312 } 313 ); 314 315 } 316 ); 317 318 } 319); 320 321 322 323/* ================================ 324 325 === KNOB ==== 326 327 ================================= */ 328 329jQuery( 330 function() { 331 332 jQuery( '.skill1' ).knob( 333 { 334 335 'max':100, 336 337 'width': 64, 338 339 'readOnly':true, 340 341 'inputColor':' #FFFFFF ', 342 343 'bgColor':' #222222 ', 344 345 'fgColor':' #e96656 ' 346 347 } 348 ); 349 350 jQuery( '.skill2' ).knob( 351 { 352 353 'max':100, 354 355 'width': 64, 356 357 'readOnly':true, 358 359 'inputColor':' #FFFFFF ', 360 361 'bgColor':' #222222 ', 362 363 'fgColor':' #34d293 ' 364 365 } 366 ); 367 368 jQuery( '.skill3' ).knob( 369 { 370 371 'max': 100, 372 373 'width': 64, 374 375 'readOnly': true, 376 377 'inputColor':' #FFFFFF ', 378 379 'bgColor':' #222222 ', 380 381 'fgColor':' #3ab0e2 ' 382 383 } 384 ); 385 386 jQuery( '.skill4' ).knob( 387 { 388 389 'max': 100, 390 391 'width': 64, 392 393 'readOnly': true, 394 395 'inputColor':' #FFFFFF ', 396 397 'bgColor':' #222222 ', 398 399 'fgColor':' #E7AC44 ' 400 401 } 402 ); 403 404 } 405); 406 407 408 409/* ====================================== 410 411 ============ MOBILE NAV =============== */ 412 413jQuery( '.navbar-toggle' ).on( 414 'click', function () { 415 416 jQuery( this ).toggleClass( 'active' ); 417 418 } 419); 420 421 422/* SETS THE HEADER HEIGHT */ 423jQuery( window ).load( 424 function(){ 425 setminHeightHeader(); 426 } 427); 428 429 430/* check if resize is actually due to window resize and not iOS */ 431var windowWidth = jQuery(window).width(); 432jQuery( window ).resize( 433 function() { 434 if ( jQuery(window).width() != windowWidth ) { 435 windowWidth = jQuery(window).width(); 436 setminHeightHeader(); 437 } 438 439 } 440); 441 442function setminHeightHeader() 443{ 444 jQuery( '#main-nav' ).css( 'min-height','75px' ); 445 jQuery( '.header' ).css( 'min-height','75px' ); 446 var minHeight = parseInt( jQuery( '#main-nav' ).height() ); 447 jQuery( '.header' ).css( 'min-height', minHeight); 448} 449/* - */ 450 451 452/* STICKY FOOTER */ 453jQuery( window ).load( fixFooterBottom ); 454jQuery( window ).resize( fixFooterBottom ); 455 456function fixFooterBottom(){ 457 458 var header = jQuery( 'header.header' ); 459 var footer = jQuery( 'footer#footer' ); 460 var content = jQuery( '.site-content > .container' ); 461 462 content.css( 'min-height', '1px' ); 463 464 var headerHeight = header.outerHeight(); 465 var footerHeight = footer.outerHeight(); 466 var contentHeight = content.outerHeight(); 467 var windowHeight = jQuery( window ).height(); 468 469 var totalHeight = headerHeight + footerHeight + contentHeight; 470 471 if (totalHeight < windowHeight) { 472 content.css( 'min-height', windowHeight - headerHeight - footerHeight ); 473 } else { 474 content.css( 'min-height','1px' ); 475 } 476} 477 478 479/*** CENTERED MENU */ 480var callback_menu_align = function () { 481 482 var headerWrap = jQuery( '.header' ); 483 var navWrap = jQuery( '#site-navigation' ); 484 var maxMenuNavWrap = jQuery('#mega-menu-primary'); 485 var logoWrap = jQuery( '.responsive-logo' ); 486 var containerWrap = jQuery( '.container' ); 487 var classToAdd = 'menu-align-center'; 488 489 490 if ( headerWrap.hasClass( classToAdd ) ) { 491 headerWrap.removeClass( classToAdd ); 492 } 493 var logoWidth = logoWrap.outerWidth(); 494 var menuWidth = navWrap.outerWidth() + maxMenuNavWrap.outerWidth(); 495 var containerWidth = containerWrap.width(); 496 497 if ( menuWidth + logoWidth > containerWidth ) { 498 headerWrap.addClass( classToAdd ); 499 } else { 500 if ( headerWrap.hasClass( classToAdd ) ) { 501 headerWrap.removeClass( classToAdd ); 502 } 503 } 504}; 505 506jQuery( window ).load( callback_menu_align ); 507jQuery( window ).resize( callback_menu_align ); 508 509var isMobile = { 510 Android: function() { 511 return navigator.userAgent.match( /Android/i ); 512 }, 513 BlackBerry: function() { 514 return navigator.userAgent.match( /BlackBerry/i ); 515 }, 516 iOS: function() { 517 return navigator.userAgent.match( /iPhone|iPad|iPod/i ); 518 }, 519 Opera: function() { 520 return navigator.userAgent.match( /Opera Mini/i ); 521 }, 522 Windows: function() { 523 return navigator.userAgent.match( /IEMobile/i ); 524 }, 525 any: function() { 526 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 527 } 528}; 529 530/* Rollover on mobile devices */ 531if ( isMobile.any() ) { 532 533 /* Our team section */ 534 jQuery( '.team-member' ).on( 535 'click', function(){ 536 jQuery( '.team-member-open' ).removeClass( 'team-member-open' ); 537 jQuery( this ).addClass( 'team-member-open' ); 538 event.stopPropagation(); 539 } 540 ); 541 jQuery( 'html' ).click( 542 function() { 543 jQuery( '.team-member-open' ).removeClass( 'team-member-open' ); 544 } 545 ); 546 547 /* Portfolio section */ 548 jQuery( document ).ready( 549 function(){ 550 jQuery( '.cbp-rfgrid li' ).prepend( '<p class="cbp-rfgrid-tr"></p>' ); 551 } 552 ); 553 jQuery( '.cbp-rfgrid li' ).on( 554 'click', function(){ 555 if ( ! jQuery( this ).hasClass( 'cbp-rfgrid-open' ) ) { 556 jQuery( '.cbp-rfgrid-tr' ).css( 'display','block' ); 557 jQuery( '.cbp-rfgrid-open' ).removeClass( 'cbp-rfgrid-open' ); 558 559 jQuery( this ).addClass( 'cbp-rfgrid-open' ); 560 jQuery( this ).find( '.cbp-rfgrid-tr' ).css( 'display','none' ); 561 event.stopPropagation(); 562 } 563 } 564 ); 565 jQuery( 'html' ).click( 566 function() { 567 jQuery( '.cbp-rfgrid-tr' ).css( 'display','block' ); 568 jQuery( '.cbp-rfgrid-open' ).removeClass( 'cbp-rfgrid-open' ); 569 } 570 ); 571 572} 573 574/* latest news */ 575jQuery( window ).load( zerif_home_latest_news ); 576jQuery( window ).resize( zerif_home_latest_news ); 577function zerif_home_latest_news(){ 578 if ( jQuery( '#carousel-homepage-latestnews' ).length > 0 ) { 579 jQuery( '#carousel-homepage-latestnews div.item' ).height( 'auto' ); 580 if ( isMobile.any() || ( ! isMobile.any() && jQuery( '.container' ).outerWidth() > 768) ) { 581 582 if ( jQuery( '#carousel-homepage-latestnews div.item' ).length < 2 ) { 583 jQuery( '#carousel-homepage-latestnews > a' ).css( 'display','none' ); 584 } 585 var maxheight = 0; 586 jQuery( '#carousel-homepage-latestnews div.item' ).each( 587 function(){ 588 if ( jQuery( this ).height() > maxheight ) { 589 maxheight = jQuery( this ).height(); 590 } 591 } 592 ); 593 jQuery( '#carousel-homepage-latestnews div.item' ).height( maxheight ); 594 } 595 } 596} 597 598/* fix for IE9 placeholders */ 599 600jQuery( document ).ready( 601 function(){ 602 603 if (document.createElement( 'input' ).placeholder === undefined) { 604 605 jQuery( '.contact-form input, .contact-form textarea' ).focus( 606 function () { 607 if ( (jQuery( this ).attr( 'placeholder' ) !== '') && (jQuery( this ).val() === jQuery( this ).attr( 'placeholder' )) ) { 608 jQuery( this ).val( '' ).removeClass( 'zerif-hasPlaceholder' ); 609 } 610 } 611 ).blur( 612 function () { 613 if ( (jQuery( this ).attr( 'placeholder' ) !== '') && (jQuery( this ).val() === '' || (jQuery( this ).val() === jQuery( this ).attr( 'placeholder' )))) { 614 jQuery( this ).val( jQuery( this ).attr( 'placeholder' ) ).addClass( 'zerif-hasPlaceholder' ); 615 } 616 } 617 ); 618 619 jQuery( '.contact-form input' ).blur(); 620 jQuery( '.contact-form textarea' ).blur(); 621 622 jQuery( 'form.contact-form' ).submit( 623 function () { 624 jQuery( this ).find( '.zerif-hasPlaceholder' ).each( function() { jQuery( this ).val( '' ); } ); 625 } 626 ); 627 } 628 } 629); 630 631/* Header section */ 632jQuery( window ).load( parallax_effect ); 633jQuery( window ).resize( parallax_effect ); 634 635function parallax_effect(){ 636 637 if ( jQuery( '#parallax_move' ).length > 0 ) { 638 var scene = document.getElementById( 'parallax_move' ); 639 var window_width = jQuery( window ).outerWidth(); 640 jQuery( '#parallax_move' ).css( 641 { 642 'width': window_width + 120, 643 'margin-left': -60, 644 'margin-top': -60, 645 'position': 'absolute', 646 } 647 );
648 var h = jQuery( 'header#home' ).outerHeight(); 649 jQuery( '#parallax_move' ).children().each( 650 function(){ 651 jQuery( this ).css( 652 { 653 'height': h + 100, 654 } 655 ); 656 } 657 ); 658 if ( ! isMobile.any() ) { 659 var parallax = new Parallax( scene ); 660 } else { 661 jQuery( '#parallax_move' ).css( 662 { 663 'z-index': '0', 664 } 665 ); 666 jQuery( '#parallax_move .layer' ).css( 667 { 668 'position': 'absolute', 669 'top': '0', 670 'left': '0', 671 'z-index': '1', 672 } 673 ); 674 } 675 } 676 677} 678 679 680/* testimonial Masonry style */ 681var window_width_old; 682var exist_class = false; 683jQuery( document ).ready( 684 function(){ 685 if ( jQuery( '.testimonial-masonry' ).length > 0 ) { 686 exist_class = true; 687 window_width_old = jQuery( '.container' ).outerWidth(); 688 if ( window_width_old < 970 ) { 689 jQuery( '.testimonial-masonry' ).zerifgridpinterest( {columns: 1,selector: '.feedback-box'} ); 690 } else { 691 jQuery( '.testimonial-masonry' ).zerifgridpinterest( {columns: 3,selector: '.feedback-box'} ); 692 } 693 } 694 } 695); 696 697jQuery( window ).resize( 698 function() { 699 if ( window_width_old !== jQuery( '.container' ).outerWidth() && exist_class === true ) { 700 window_width_old = jQuery( '.container' ).outerWidth(); 701 if ( window_width_old < 970 ) { 702 jQuery( '.testimonial-masonry' ).zerifgridpinterest( {columns: 1,selector: '.feedback-box'} ); 703 } else { 704 jQuery( '.testimonial-masonry' ).zerifgridpinterest( {columns: 3,selector: '.feedback-box'} ); 705 } 706 } 707 } 708); 709 710;(function ($, window, document, undefined) { 711 var defaults = { 712 columns: 3, 713 selector: 'div', 714 excludeParentClass: '', 715 }; 716 function ZerifGridPinterest(element, options) { 717 this.element = element; 718 this.options = $.extend( {}, defaults, options ); 719 this.defaults = defaults; 720 this.init(); 721 } 722 ZerifGridPinterest.prototype.init = function () { 723 var self = this, 724 $container = $( this.element ); 725 $select_options = $( this.element ).children(); 726 self.make_magic( $container, $select_options ); 727 }; 728 ZerifGridPinterest.prototype.make_magic = function (container) { 729 var self = this; 730 $container = $( container ), 731 columns_height = [], 732 prefix = 'zerif', 733 unique_class = prefix + '_grid_' + self.make_unique(); 734 local_class = prefix + '_grid'; 735 var classname; 736 var substr_index = this.element.className.indexOf( prefix + '_grid_' ); 737 if ( substr_index > -1 ) { 738 classname = this.element.className.substr( 0, this.element.className.length - unique_class.length - local_class.length - 2 ); 739 } else { 740 classname = this.element.className; 741 } 742 var my_id; 743 if ( this.element.id === '' ) { 744 my_id = prefix + '_id_' + self.make_unique(); 745 } else { 746 my_id = this.element.id; 747 } 748 $container.after( '<div id="' + my_id + '" class="' + classname + ' ' + local_class + ' ' + unique_class + '"></div>' ); 749 var i; 750 for (i = 1; i <= this.options.columns; i++) { 751 columns_height.push( 0 ); 752 var first_cols = ''; 753 var last_cols = ''; 754 if ( i % self.options.columns == 1 ) { 755 first_cols = prefix + '_grid_first'; } 756 if ( i % self.options.columns == 0 ) { 757 first_cols = prefix + '_grid_last'; } 758 $( '.' + unique_class ).append( '<div class="' + prefix + '_grid_col_' + this.options.columns + ' ' + prefix + '_grid_column_' + i + ' ' + first_cols + ' ' + last_cols + '"></div>' ); 759 } 760 if ( this.element.className.indexOf( local_class ) < 0 ) { 761 $container.children( this.options.selector ).each( 762 function(index){ 763 var min = Math.min.apply( null,columns_height ); 764 var this_index = columns_height.indexOf( min ) + 1; 765 $( this ).attr( prefix + 'grid-attr','this-' + index ).appendTo( '.' + unique_class + ' .' + prefix + '_grid_column_' + this_index ); 766 columns_height[this_index - 1] = $( '.' + unique_class + ' .' + prefix + '_grid_column_' + this_index ).height(); 767 } 768 ); 769 } else { 770 var no_boxes = $container.find( this.options.selector ).length; 771 var i; 772 for ( i = 0; i < no_boxes; i++ ) { 773 var min = Math.min.apply( null,columns_height ); 774 var this_index = columns_height.indexOf( min ) + 1;
775 $( '#' + this.element.id ).find( '[' + prefix + 'grid-attr="this-' + i + '"]' ).appendTo( '.' + unique_class + ' .' + prefix + '_grid_column_' + this_index ); 776 columns_height[this_index - 1] = $( '.' + unique_class + ' .' + prefix + '_grid_column_' + this_index ).height(); 777 } 778 } 779 $container.remove(); 780 } 781 ZerifGridPinterest.prototype.make_unique = function () { 782 var text = ''; 783 var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 784 for ( var i = 0; i < 10; i++ ) { 785 text += possible.charAt( Math.floor( Math.random() * possible.length ) ); 786 } 787 return text; 788 } 789 $.fn.zerifgridpinterest = function (options) { 790 return this.each( 791 function () { 792 var value = ''; 793 if ( ! $.data( this, value )) { 794 $.data( this, value, new ZerifGridPinterest( this, options ) ); 795 } 796 } 797 ); 798 } 799})( jQuery ); 800 801 802/* mobile background fix */ 803var initHeight = 0, 804 initWidth = 0; 805var initViewMode, 806 onlyInit = true; 807jQuery( document ).ready( 808 function() { 809 initViewMode = type_view(); 810 mobile_bg_fix(); 811 } 812); 813jQuery( window ).resize( mobile_bg_fix ); 814 815function mobile_bg_fix() { 816 if ( isMobile.any() && jQuery( 'body.custom-background' ) ) { 817 var viewMode = type_view(); 818 if ( initViewMode !== viewMode || onlyInit == true ) { 819 jQuery( '.mobile-bg-fix-img' ).css( 820 { 821 'width' : window.innerWidth, 822 'height': window.innerHeight + 100 823 } 824 ); 825 initViewMode = viewMode; 826 if ( onlyInit == true ) { 827 onlyInit = false; 828 bodyClass = jQuery( 'body.custom-background' ); 829 imgURL = bodyClass.css( 'background-image' ); 830 imgSize = bodyClass.css( 'background-size' ); 831 imgPosition = bodyClass.css( 'background-position' ); 832 imgRepeat = bodyClass.css( 'background-repeat' ); 833 jQuery( '#mobilebgfix' ).addClass( 'mobile-bg-fix-wrap' ).find( '.mobile-bg-fix-img' ).css( 834 { 835 'background-size': imgSize, 836 'background-position': imgPosition, 837 'background-repeat': imgRepeat, 838 'background-image': imgURL 839 } 840 ); 841 if ( ! imgURL ) { 842 jQuery( '.mobile-bg-fix-wrap .mobile-bg-fix-img-wrap' ).css( 'display','none' ); 843 } 844 } 845 } 846 } 847} 848 849function type_view() { 850 var initHeight = window.innerHeight; 851 var initWidth = window.innerWidth; 852 if ( initWidth <= initHeight ) { 853 return 'portrait'; 854 } 855 return 'landscape'; 856}; 857 858 859 860/* Menu levels */(function ($, window) { 861 var defaults = { 862 // 'true' -> if there is a big submenu all submenu will be aligned to the right 863 // 'false' -> Only big submenu will be aligned to the right 864 allItems: false, 865 }; 866 function ZerifSubmenuOrientation(element, options) { 867 this.element = element; 868 this.options = $.extend( {}, defaults, options ); 869 this.defaults = defaults; 870 this.init(); 871 } 872 ZerifSubmenuOrientation.prototype.init = function () { 873 var self = this, 874 $container = $( this.element ), 875 $select_options = $( this.element ).children(); 876 var resize_finish; 877 if ( self.options.allItems !== true ) { 878 $( window ).resize( 879 function() { 880 clearTimeout( resize_finish ); 881 resize_finish = setTimeout( 882 function () { 883 self.make_magic( $container, $select_options ); 884 }, 11 885 ); 886 } 887 ); 888 } 889 self.make_magic( $container, $select_options ); 890 if ( self.options.allItems !== true ) { 891 setTimeout( 892 function() { 893 $( window ).resize(); 894 }, 500 895 ); 896 } 897 }; 898 ZerifSubmenuOrientation.prototype.make_magic = function (container, select_options) { 899 var self = this, 900 $container = $( container ), 901 $select_options = $( select_options ); 902 var itemWrap; 903 if ( $container[0].tagName == 'UL' ) { 904 itemWrap = $container[0]; 905 } else { 906 itemWrap = $container.find( 'ul' )[0]; 907 } 908 var windowsWidth = window.innerWidth; 909 if ( typeof itemWrap !== 'undefined' ) { 910 var itemId = '#' + itemWrap.id; 911 $( itemId ).children( 'li' ).each( 912 function() { 913 if ( this.id == '' ) { 914 return; } 915 var max_deep = self.max_deep( '#' + this.id ); 916 var offsetLeft = $( '#' + this.id ).offset().left; 917 var submenuWidthItem = $( '#' + this.id ).find( 'ul' ).width(); 918 var submenuTotalWidth = max_deep * submenuWidthItem; 919 if ( submenuTotalWidth > 0 && windowsWidth < offsetLeft + submenuTotalWidth ) { 920 if ( self.options.allItems === true ) { 921 $( '#' + itemWrap.id ).addClass( 'menu-item-open-left-all' ); 922 return false;
923 } 924 $( '#' + this.id ).addClass( 'menu-item-open-left' ); 925 } else if ( $( '#' + this.id ).hasClass( 'menu-item-open-left' ) ) { 926 $( '#' + this.id ).removeClass( 'menu-item-open-left' ); 927 } 928 } 929 ); 930 } 931 }; 932 ZerifSubmenuOrientation.prototype.max_deep = function ( item ) { 933 var maxDepth = -1, 934 currentDepth = -1; 935 $( item + ' li:not(:has(ul))' ).each( 936 function() { 937 currentDepth = $( this ).parents( 'ul' ).length; 938 if (currentDepth > maxDepth) { 939 maxDepth = currentDepth; 940 } 941 } 942 ); 943 return maxDepth - 1; 944 } 945 $.fn.zerifsubmenuorientation = function (options) { 946 return this.each( 947 function () { 948 var value = ''; 949 if ( ! $.data( this, value )) { 950 $.data( this, value, new ZerifSubmenuOrientation( this, options ) ); 951 } 952 } 953 ); 954 } 955})( jQuery,window ); 956jQuery( document ).ready( 957 function() { 958 jQuery( '#site-navigation' ).zerifsubmenuorientation(); 959 } 960);
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.