1(function($){ 2 3 4 /* --------------------------------------------------------------------------- 5 * Helper Item 6 * --------------------------------------------------------------------------- */ 7 8 jQuery('.helper .link.toggle').click( function(e){ 9 10 e.preventDefault(); 11 12 var el = jQuery(this); 13 var id = el.attr('data-rel'); 14 var parent = el.closest('.helper'); 15 16 if( el.hasClass('active') ){ 17 18 el.removeClass('active'); 19 parent.find('.helper_content > .item-' + id ).removeClass('active').slideUp(200); 20 21 } else { 22 23 parent.find('.links > .link.active').removeClass('active'); 24 parent.find('.helper_content > .item.active').slideUp(200) 25 26 el.addClass('active'); 27 parent.find('.helper_content > .item-' + id ).addClass('active').slideDown(200); 28 29 } 30 31 setTimeout(function(){ 32 mfn_sidebar(); 33 },200); 34 35 }); 36 37 38 "use strict"; 39 jQuery(window).bind("debouncedresize", function() { 40 41 iframesHeight(); 42 43 // Isotope | Relayout 44 jQuery('.masonry.isotope').isotope(); 45 jQuery('.masonry.gallery').isotope( 'layout'); 46 47 // Zoom Box | Vertical Align 48 zoomBoxVerticalAlign(); 49 50 }); 51 /* --------------------------------------------------------------------------- 52 * Zoom Box | Vertical Align 53 * --------------------------------------------------------------------------- */ 54 function zoomBoxVerticalAlign(){ 55 jQuery('body:not(.style-simple) .zoom_box').each(function(){ 56 57 var el = jQuery(this); 58 var elH = el.height(); 59 var desc = el.find('.desc_wrap'); 60 var descH = desc.height(); 61 62 var padding = ( elH - descH ) / 2; 63 64 desc.css( 'padding-top', padding +'px' ); 65 66 }); 67 } 68 zoomBoxVerticalAlign(); 69 70 /* --------------------------------------------------------------------------- 71 * Iframe height 72 * --------------------------------------------------------------------------- */ 73 function iframeHeight( item, ratio ){ 74 var itemW = item.width(); 75 var itemH = itemW * ratio; 76 if( itemH < 147 ) itemH = 147; 77 item.height(itemH); 78 } 79 80 function iframesHeight(){ 81 iframeHeight(jQuery(".blog_wrapper .post-photo-wrapper .mfn-jplayer, .blog_wrapper .post-photo-wrapper iframe, .post-related .mfn-jplayer, .post-related iframe, .blog_slider_ul .mfn-jplayer, .blog_slider_ul iframe"), 0.78); // blog - list 82 iframeHeight(jQuery(".single-post .single-photo-wrapper .mfn-jplayer, .single-post .single-photo-wrapper iframe" ), 0.4); // blog - single 83 84 iframeHeight(jQuery(".section-portfolio-header .mfn-jplayer, .section-portfolio-header iframe" ), 0.4); // portfolio - single 85 } 86 iframesHeight(); 87 88 89 /* --------------------------------------------------------------------------- 90 * Sticky header 91 * --------------------------------------------------------------------------- */ 92 var topBarTop = '61px'; 93 var mfn_header_height = 0; 94 95 // header height 96 function mfn_stickyH(){ 97 if( jQuery('body').hasClass('header-below') ){ 98 // header below slider 99 mfn_header_height = jQuery('.mfn-main-slider').innerHeight() + jQuery('#Header').innerHeight(); 100 } else { 101 // default 102 mfn_header_height = jQuery('#Top_bar').innerHeight() + jQuery('#Action_bar').innerHeight(); 103 } 104 } 105 106 // init 107 function mfn_sticky(){ 108 if( jQuery('body').hasClass('sticky-header') ){ 109 var start_y = mfn_header_height; 110 var window_y = jQuery(window).scrollTop(); 111 112 if( window_y > start_y ){ 113 if( ! (jQuery('#Top_bar').hasClass('is-sticky'))){ 114 115 jQuery('.header-classic .header_placeholder').css('height', jQuery('#Top_bar').innerHeight() - jQuery('#Action_bar').innerHeight()); 116 jQuery('.header-stack .header_placeholder').css('height', 71); 117 jQuery('.header-below .header_placeholder').css('height', jQuery('#Top_bar').innerHeight()); 118 jQuery('.minimalist-header .header_placeholder').css('height', jQuery('#Top_bar').innerHeight()); 119 120 jQuery('#Top_bar') 121 .addClass('is-sticky') 122 .css('top',-60) 123 .animate({ 124 'top': jQuery('#wpadminbar').innerHeight() 125 },300); 126 } 127 } 128 else { 129 if(jQuery('#Top_bar').hasClass('is-sticky')) { 130 jQuery('.header_placeholder').css('height',0); 131 jQuery('#Top_bar') 132 .removeClass('is-sticky') 133 .css('top', topBarTop); 134 } 135 } 136 } 137 } 138 139 140 /* --------------------------------------------------------------------------- 141 * Sidebar height 142 * --------------------------------------------------------------------------- */ 143 function mfn_sidebar(){ 144 if( jQuery('.with_aside .four.columns').length ){ 145 var maxH = jQuery('#Content .sections_group').height() - 20 146 jQuery('.with_aside .four.columns .widget-area').each(function(){ 147 jQuery(this).css( 'min-height', 0 ); 148 if( jQuery(this).height() > maxH ){ 149 maxH = jQuery(this).height(); 150 } 151 }); 152 jQuery('.with_aside .four.columns .widget-area').css( 'min-height', maxH + 'px' ); 153 } 154 } 155 156 157 158 /* --------------------------------------------------------------------------- 159 * Equal Wraps | Height 160 * --------------------------------------------------------------------------- */ 161 function mfn_equalH_wrap(){ 162 jQuery('.section.equal-height-wrap .section_wrapper').each(function(){ 163 var maxH = 0; 164 jQuery('> .wrap', jQuery(this) ).each(function(){ 165 jQuery(this).css( 'height', 'auto' ); 166 if( jQuery(this).innerHeight() > maxH ){ 167 maxH = jQuery(this).innerHeight(); 168 } 169 }); 170 jQuery('> .wrap', jQuery(this) ).css( 'height', maxH + 'px' ); 171 }); 172 } 173 174 175 /* --------------------------------------------------------------------------- 176 * Equal Items | Height 177 * --------------------------------------------------------------------------- */ 178 function mfn_equalH(){ 179 jQuery('.section.equal-height .mcb-wrap-inner').each(function(){ 180 var maxH = 0; 181 182 jQuery('> .column', jQuery(this) ).each(function(){ 183 jQuery(this).css( 'height', 'auto' ); 184 if( jQuery(this).height() > maxH ){ 185 maxH = jQuery(this).height(); 186 } 187 }); 188 jQuery('> .column', jQuery(this) ).css( 'height', maxH + 'px' ); 189 }); 190 } 191 192 193 194 /* --------------------------------------------------------------------------- 195 * Overlay menu 196 * --------------------------------------------------------------------------- */ 197 jQuery('.overlay-menu-toggle').click(function(e){ 198 e.preventDefault(); 199 200 jQuery(this).toggleClass('focus'); 201 jQuery('#Overlay').stop(true,true).fadeToggle(500); 202 203 var menuH = jQuery('#Overlay nav').height() / 2; 204 jQuery('#Overlay nav').css( 'margin-top', '-' + menuH + 'px' ); 205 }); 206 207 /* --------------------------------------------------------------------------- 208 * Sliding Footer | Height 209 * --------------------------------------------------------------------------- */ 210 function mfn_footer(){ 211 if( jQuery('.footer-fixed #Footer, .footer-sliding #Footer').length ){ 212 var footerH = jQuery('#Footer').height(); 213 jQuery('#Content').css( 'margin-bottom', footerH + 'px' ); 214 } 215 } 216 217 218 /* --------------------------------------------------------------------------- 219 * Header width 220 * --------------------------------------------------------------------------- */ 221 function mfn_header(){ 222 var rightW = jQuery('.top_bar_right').innerWidth(); 223 var parentW = jQuery('#Top_bar .one').innerWidth() - 10; 224 var leftW = parentW - rightW; 225 jQuery('.top_bar_left, .menu > li > ul.mfn-megamenu ').width( leftW ); 226 } 227 228 229 /* --------------------------------------------------------------------------- 230 * Full Screen Section 231 * --------------------------------------------------------------------------- */ 232 function mfn_sectionH(){ 233 var windowH = jQuery(window).height(); 234 jQuery('.section.full-screen').each(function(){ 235 var section = jQuery(this); 236 var wrapper = jQuery('.section_wrapper',section); 237 section 238 .css('padding', 0) 239 .height( windowH ); 240 var padding = ( windowH - wrapper.height() ) / 2; 241 wrapper.css('padding-top', padding + 20); // 20 = column margin-bottom / 2 242 }); 243 } 244 245 246 /* --------------------------------------------------------------------------- 247 * # Hash smooth navigation 248 * --------------------------------------------------------------------------- */ 249 function hashNav(){ 250 251 // # window.location.hash 252 var hash = window.location.hash; 253 254 if( hash && jQuery(hash).length ){ 255 256 var stickyH = jQuery('.sticky-header #Top_bar').innerHeight(); 257 var tabsHeaderH = jQuery(hash).siblings('.ui-tabs-nav').innerHeight(); 258 259 jQuery('html, body').animate({ 260 scrollTop: jQuery(hash).offset().top - stickyH - tabsHeaderH 261 }, 500); 262 } 263 } 264 265 266 /* --------------------------------------------------------------------------- 267 * One Page | Scroll Active 268 * --------------------------------------------------------------------------- */ 269 function onePageActive(){ 270 if( jQuery('body').hasClass('one-page') ){ 271 272 var stickyH = jQuery('.sticky-header #Top_bar').innerHeight(); 273 274 var winTop = jQuery(window).scrollTop(); 275 var offset = stickyH + 1; // offset top 276 277 var visible = jQuery('[data-id]').filter(function(ndx, div){ 278 return winTop >= jQuery(div).offset().top - offset && 279 winTop < jQuery(div).offset().top - offset + jQuery(div).outerHeight() 280 }); 281 282 var newActive = visible.first().attr('id'); 283 var active = '[data-hash="#'+ newActive +'"]'; 284 285 if( newActive ){ 286 var menu = jQuery('#menu'); 287 menu.find('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor'); 288 jQuery( active, menu ).closest('li').addClass('current-menu-item'); 289 } 290 291 } 292 } 293 294 295 /* --------------------------------------------------------------------------- 296 * niceScroll | Padding right fix for short content 297 * --------------------------------------------------------------------------- */ 298 function niceScrollFix(){ 299 var el = jQuery('body > .nicescroll-rails'); 300 if( el.length ){ 301 if( el.is(":visible") ){ 302 jQuery('body').addClass('nice-scroll'); 303 } else { 304 jQuery('body').removeClass('nice-scroll'); 305 } 306 } 307 } 308 309 310 /* -------------------------------------------------------------------------------------------------------------------------- 311 * jQuery(document).ready 312 * ----------------------------------------------------------------------------------------------------------------------- */ 313 jQuery(document).ready(function(){ 314
315 topBarTop = parseInt(jQuery('#Top_bar').css('top'), 10); 316 if( topBarTop < 0 ) topBarTop = 61; 317 topBarTop = topBarTop + 'px'; 318 319 320 321 /* --------------------------------------------------------------------------- 322 * TwentyTwenty [ before_after ] 323 * --------------------------------------------------------------------------- */ 324 jQuery('.before_after.twentytwenty-container').twentytwenty(); 325 326 327 /* --------------------------------------------------------------------------- 328 * Content sliders 329 * --------------------------------------------------------------------------- */ 330 mfnSliderContent(); 331 mfnSliderOffer(); 332 mfnSliderOfferThumb(); 333 mfnSliderBlog(); 334 mfnSliderClients(); 335 mfnSliderPortfolio(); 336 mfnSliderShop(); 337 mfnSliderTestimonials(); 338 mfn_equalH_wrap(); 339 mfn_equalH(); 340 341 342 /* --------------------------------------------------------------------------- 343 * Responsive menu 344 * --------------------------------------------------------------------------- */ 345 jQuery('.responsive-menu-toggle').click(function(e){ 346 e.preventDefault(); 347 var el = jQuery(this) 348 var menu = jQuery('#Top_bar #menu'); 349 var menuWrap = menu.closest('.menu_wrapper'); 350 el.toggleClass('active'); 351 352 if( el.hasClass('is-sticky') && el.hasClass('active') ){ 353 var top = 0; 354 if( menuWrap.length ) top = menuWrap.offset().top; 355 jQuery('body,html').animate({ 356 scrollTop: top 357 }, 200); 358 } 359 360 menu.stop(true,true).slideToggle(200); 361 }); 362 363 364 /* --------------------------------------------------------------------------- 365 * Main menu 366 * --------------------------------------------------------------------------- */ 367 368 // Muffin Menu ------------------------------- 369 jQuery("#menu > ul.menu").muffingroup_menu({ 370 arrows : true 371 }); 372 373 jQuery("#secondary-menu > ul.secondary-menu").muffingroup_menu(); 374 375 mfn_stickyH() 376 mfn_sticky(); 377 378 379 /* --------------------------------------------------------------------------- 380 * Menu | OnePage - remove active 381 * Works with .scroll class 382 * Since 4.8 replaced with admin option: Page Options / One Page [function: onePageMenu()] 383 * --------------------------------------------------------------------------- */ 384 function onePageScroll(){ 385 if( ! jQuery('body').hasClass('one-page') ){ 386 var menu = jQuery('#menu'); 387 388 if( menu.find('li.scroll').length > 1 ){ 389 menu.find('li.current-menu-item:not(:first)').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor'); 390 391 // menu item click 392 menu.find('a').click(function(){ 393 jQuery(this).closest('li').siblings('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor'); 394 jQuery(this).closest('li').addClass('current-menu-item'); 395 }); 396 } 397 } 398 } 399 onePageScroll(); 400 401 402 /* --------------------------------------------------------------------------- 403 * One Page | Menu with Active on Scroll 404 * --------------------------------------------------------------------------- */ 405 function onePageMenu(){ 406 if( jQuery('body').hasClass('one-page') ){ 407 408 var menu = jQuery('#menu'); 409 410 // remove active 411 menu.find('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor'); 412 413 // add attr [data-hash] 414 jQuery('a[href]', menu).each(function(){ 415 416 // data-hash 417 var url = jQuery(this).attr('href'); 418 var hash = '#' + url.split('#')[1]; 419 if( hash && jQuery(hash).length ){ // check if element with specified ID exists 420 jQuery(this).attr('data-hash',hash); 421 jQuery(hash).attr('data-id',hash); 422 } 423 424 }); 425 426 // click 427 jQuery('#menu a[data-hash]').click(function(e){ 428 e.preventDefault(); // only with: body.one-page 429 430 // active 431 menu.find('li').removeClass('current-menu-item'); 432 jQuery(this).closest('li').addClass('current-menu-item'); 433 434 var hash = jQuery(this).attr('data-hash'); 435 var stickyH = 0; 436 var tabsHeaderH = jQuery(hash).siblings('.ui-tabs-nav').innerHeight(); 437 438 // FIX | sticky top bar height 439 var topBar = jQuery('.sticky-header #Top_bar'); 440 if( topBar.hasClass('is-sticky') ){ 441 stickyH = jQuery('.sticky-header #Top_bar').innerHeight(); 442 } else { 443 topBar.addClass('is-sticky'); 444 stickyH = jQuery('.sticky-header #Top_bar').innerHeight(); 445 topBar.removeClass('is-sticky'); 446 } 447 448 // FIX | responsive 449 var responsive = jQuery('.responsive-menu-toggle'); 450 if( responsive.length ){ 451 if( responsive.is(":visible") ){ 452 stickyH = 0; 453 } 454 } 455 456 jQuery('html, body').animate({ 457 scrollTop: jQuery(hash).offset().top - stickyH - tabsHeaderH 458 }, 500); 459 460 }); 461 462 } 463 }; 464 onePageMenu(); 465 466 467 468 /* --------------------------------------------------------------------------- 469 * Creative Header 470 * --------------------------------------------------------------------------- */ 471 var cHeader = 'body:not(.header-open) #Header_creative'; 472 var cHeaderEl = jQuery( cHeader ); 473 var cHeaderCurrnet; 474 475 function creativeHeader(){ 476 477 jQuery('.creative-menu-toggle').click(function(e){ 478 e.preventDefault(); 479 480 cHeaderEl.addClass('active') 481 482 if( jQuery('body').hasClass('header-rtl') ){ 483 cHeaderEl.animate({ 'right':-1 }, 500); 484 } else { 485 cHeaderEl.animate({ 'left':-1 }, 500); 486 } 487 488 489 cHeaderEl.find('.creative-wrapper').fadeIn(500); 490 cHeaderEl.find('.creative-menu-toggle, .creative-social').fadeOut(500); 491 }); 492 493 } 494 creativeHeader(); 495 496 jQuery(document).on('mouseenter', cHeader, function() { 497 cHeaderCurrnet = 1; 498 }) 499 500 jQuery(document).on('mouseleave', cHeader, function() { 501 cHeaderCurrnet = null; 502 setTimeout(function(){ 503 if ( ! cHeaderCurrnet ){ 504 505 cHeaderEl.removeClass('active'); 506 507 if( jQuery('body').hasClass('header-rtl') ){ 508 cHeaderEl.animate({ 'right':-200 }, 500); 509 } else { 510 cHeaderEl.animate({ 'left':-200 }, 500); 511 } 512 513 cHeaderEl.find('.creative-wrapper').fadeOut(500); 514 cHeaderEl.find('.creative-menu-toggle, .creative-social').fadeIn(500); 515 } 516 }, 1000); 517 }); 518 519 520 521 /* --------------------------------------------------------------------------- 522 * Maintenance 523 * --------------------------------------------------------------------------- */ 524 jQuery('.downcount').each(function(){ 525 var el = jQuery(this); 526 el.downCount({ 527 date : el.attr('data-date'), 528 offset : el.attr('data-offset') 529 }); 530 }); 531 532 533 /* --------------------------------------------------------------------------- 534 * Tooltip Image 535 * --------------------------------------------------------------------------- */ 536 jQuery('.tooltip-img').hover(function(){ 537 jQuery('.tooltip-content').stop(true,true).show(); 538 },function(){ 539 jQuery('.tooltip-content').stop(true,true).hide(); 540 }); 541 542 543 /* --------------------------------------------------------------------------- 544 * Popup Contact 545 * --------------------------------------------------------------------------- */ 546 jQuery("#popup_contact > a.button").click(function(e){ 547 e.preventDefault(); 548 jQuery(this).parent().toggleClass('focus'); 549 }); 550 551 552 /* --------------------------------------------------------------------------- 553 * niceScroll 554 * --------------------------------------------------------------------------- */ 555 if( jQuery('body').hasClass('nice-scroll-on') 556 && jQuery(window).width() > 767 557 && ! navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) 558 { 559 jQuery('html').niceScroll({ 560 autohidemode : false, 561 cursorborder : 0,
562 cursorborderradius : 5, 563 cursorcolor : '#222222', 564 cursorwidth : 10, 565 horizrailenabled : false, 566 mousescrollstep : ( window.mfn_nicescroll ) ? window.mfn_nicescroll : 40, 567 scrollspeed : 60 568 }); 569 570 jQuery('body').removeClass('nice-scroll-on').addClass('nice-scroll'); 571 niceScrollFix(); 572 } 573 574 575 /* --------------------------------------------------------------------------- 576 * WP Gallery 577 * --------------------------------------------------------------------------- */ 578 jQuery('.gallery-icon > a') 579 .wrap('<div class="image_frame scale-with-grid"><div class="image_wrapper"></div></div>') 580 .prepend('<div class="mask"></div>') 581 .attr('rel', 'prettyphoto[gallery]') 582 .attr('data-rel', 'prettyphoto[gallery]') 583 .children('img' ) 584 .css('height', 'auto') 585 .css('width', '100%'); 586 587 588 /* --------------------------------------------------------------------------- 589 * PrettyPhoto 590 * --------------------------------------------------------------------------- */ 591 592 if( ( typeof(window.mfn_prettyphoto) !== 'undefined' && ! window.mfn_prettyphoto.disable ) ){ 593 jQuery('a[rel^="prettyphoto"],a.woocommerce-main-image.zoom, .prettyphoto, a[data-rel^="prettyPhoto[product-gallery]"]').prettyPhoto({ 594 default_width : window.mfn_prettyphoto.width ? window.mfn_prettyphoto.width : 500, 595 default_height : window.mfn_prettyphoto.height ? window.mfn_prettyphoto.height : 344, 596 show_title : false, 597 deeplinking : false, 598 social_tools: false 599 }); 600 } 601 602 603 /* --------------------------------------------------------------------------- 604 * Black & White 605 * --------------------------------------------------------------------------- */ 606 jQuery('.greyscale .image_wrapper > a, .greyscale .client_wrapper .gs-wrapper, .greyscale.portfolio-photo a').has('img').BlackAndWhite({ 607 hoverEffect : true, 608 intensity : 1 // opacity: 0, 0.1, ... 1 609 }); 610 611 612 /* --------------------------------------------------------------------------- 613 * Sliding Top 614 * --------------------------------------------------------------------------- */ 615 jQuery(".sliding-top-control").click(function(e){ 616 e.preventDefault(); 617 jQuery('#Sliding-top .widgets_wrapper').slideToggle(); 618 jQuery('#Sliding-top').toggleClass('active'); 619 }); 620 621 622 /* --------------------------------------------------------------------------- 623 * Header Search 624 * --------------------------------------------------------------------------- */ 625 jQuery("#search_button, #Top_bar .icon_close").click(function(e){ 626 e.preventDefault(); 627 jQuery('#Top_bar .search_wrapper').fadeToggle(); 628 }); 629 630 631 /* --------------------------------------------------------------------------- 632 * Alert 633 * --------------------------------------------------------------------------- */ 634 jQuery('.alert .close').click(function(e){ 635 e.preventDefault(); 636 jQuery(this).closest('.alert').hide(300); 637 }); 638 639 640 /* --------------------------------------------------------------------------- 641 * Buttons - mark Buttons with Icon & Label 642 * --------------------------------------------------------------------------- */ 643 jQuery('a.button_js').each(function(){ 644 var btn = jQuery(this); 645 if( btn.find('.button_icon').length && btn.find('.button_label').length ){ 646 btn.addClass('kill_the_icon'); 647 } 648 }); 649 650 651 /* --------------------------------------------------------------------------- 652 * Posts sticky navigation 653 * --------------------------------------------------------------------------- */ 654 jQuery('.fixed-nav').appendTo('body'); 655 656 657 /* --------------------------------------------------------------------------- 658 * Feature List 659 * --------------------------------------------------------------------------- */ 660 jQuery('.feature_list ul li:nth-child(4n):not(:last-child)').after('<hr />'); 661 662 663 /* --------------------------------------------------------------------------- 664 * IE fixes 665 * --------------------------------------------------------------------------- */ 666 function checkIE(){ 667 // IE 9 668 var ua = window.navigator.userAgent; 669 var msie = ua.indexOf("MSIE "); 670 if( msie > 0 && parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))) == 9 ){ 671 jQuery("body").addClass("ie"); 672 } 673 } 674 checkIE(); 675 676 677 /* ---------------------------------------------------------------------------
678 * Paralex Backgrounds 679 * --------------------------------------------------------------------------- */ 680 var ua = navigator.userAgent, 681 isMobileWebkit = /WebKit/.test(ua) && /Mobile/.test(ua); 682 if( ! isMobileWebkit && jQuery(window).width() >= 768 ){ 683 $.stellar({ 684 horizontalScrolling : false, 685 responsive : true 686 }); 687 } 688 689 690 /* --------------------------------------------------------------------------- 691 * Ajax | Load More 692 * --------------------------------------------------------------------------- */ 693 jQuery('.pager_load_more').click(function(e){ 694 e.preventDefault(); 695 696 var el = jQuery(this); 697 var pager = el.closest('.pager_lm'); 698 var href = el.attr('href'); 699 700 // index | for many items on the page 701 var index = jQuery('.lm_wrapper').index(el.closest('.isotope_wrapper').find('.lm_wrapper')); 702 703 el.fadeOut(50); 704 pager.addClass('loading'); 705 706 $.get( href, function(data){ 707 708 // content 709 var content = jQuery('.lm_wrapper:eq('+ index +')', data).wrapInner('').html(); 710 711 if( jQuery('.lm_wrapper:eq('+ index +')').hasClass('isotope') ){ 712 // isotope 713 jQuery('.lm_wrapper:eq('+ index +')').append( jQuery(content) ).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); 714 } else { 715 // default 716 jQuery( content ).hide().appendTo('.lm_wrapper:eq('+ index +')').fadeIn(1000); 717 } 718 719 // next page link 720 href = jQuery( '.pager_load_more:eq('+ index +')', data ).attr('href'); 721 pager.removeClass('loading'); 722 if( href ){ 723 el.fadeIn(); 724 el.attr( 'href', href ); 725 } 726 727 // refresh some staff ------------------------------- 728 mfn_jPlayer(); 729 iframesHeight(); 730 mfn_sidebar(); 731 732 // isotope fix: second resize 733 setTimeout(function(){ 734 jQuery('.lm_wrapper.isotope').isotope( 'reLayout'); 735 },1000); 736 737 }); 738 739 }); 740 741 742 /* --------------------------------------------------------------------------- 743 * Blog & Portfolio filters 744 * --------------------------------------------------------------------------- */ 745 jQuery('.filters_buttons .open').click(function(e){ 746 e.preventDefault(); 747 var type = jQuery(this).closest('li').attr('class'); 748 jQuery('.filters_wrapper').show(200); 749 jQuery('.filters_wrapper ul.'+ type).show(200); 750 jQuery('.filters_wrapper ul:not(.'+ type +')').hide(); 751 }); 752 753 jQuery('.filters_wrapper .close a').click(function(e){ 754 e.preventDefault(); 755 jQuery('.filters_wrapper').hide(200); 756 }); 757 758 759 /* --------------------------------------------------------------------------- 760 * Portfolio List - next/prev buttons 761 * --------------------------------------------------------------------------- */ 762 jQuery('.portfolio_next_js').click(function(e){ 763 e.preventDefault(); 764 765 var stickyH = jQuery('#Top_bar.is-sticky').innerHeight(); 766 var item = jQuery(this).closest('.portfolio-item').next(); 767 768 if( item.length ){ 769 jQuery('html, body').animate({ 770 scrollTop: item.offset().top - stickyH 771 }, 500); 772 } 773 }); 774 775 jQuery('.portfolio_prev_js').click(function(e){ 776 e.preventDefault(); 777 778 var stickyH = jQuery('#Top_bar.is-sticky').innerHeight(); 779 var item = jQuery(this).closest('.portfolio-item').prev(); 780 781 if( item.length ){ 782 jQuery('html, body').animate({ 783 scrollTop: item.offset().top - stickyH 784 }, 500); 785 } 786 }); 787 788 789 /* --------------------------------------------------------------------------- 790 * Tabs 791 * --------------------------------------------------------------------------- */ 792 793 if(typeof(tabs) !== 'undefined'){ 794 jQuery(".jq-tabs").tabs(); 795 } 796 797 798 /* --------------------------------------------------------------------------- 799 * Smooth scroll 800 * --------------------------------------------------------------------------- */ 801 jQuery('li.scroll > a, a.scroll').click(function(){ 802 var url = jQuery(this).attr('href'); 803 var hash = '#' + url.split('#')[1]; 804 805 var stickyH = jQuery('.sticky-header #Top_bar').innerHeight(); 806 var tabsHeaderH = jQuery(hash).siblings('.ui-tabs-nav').innerHeight(); 807 808 if( hash && jQuery(hash).length ){ 809 jQuery('html, body').animate({ 810 scrollTop: jQuery(hash).offset().top - stickyH - tabsHeaderH 811 }, 500); 812 } 813 }); 814 815 816 /* --------------------------------------------------------------------------- 817 * Muffin Accordion & FAQ 818 * --------------------------------------------------------------------------- */ 819 jQuery('.mfn-acc').each(function(){ 820 var el = jQuery(this); 821 822 if( el.hasClass('openAll') ){ 823 // show all ----------- 824 825 el.find('.question') 826 .addClass("active") 827 .children(".answer") 828 .show(); 829 830 } else { 831 // show one ----------- 832 833 var active_tab = el.attr('data-active-tab'); 834 if( el.hasClass('open1st') ) active_tab = 1; 835 836 if( active_tab ){ 837 el.find('.question').eq( active_tab - 1 ) 838 .addClass("active") 839 .children(".answer") 840 .show(); 841 } 842 843 } 844 }); 845 846 jQuery(".mfn-acc .question > .title").click(function(){ 847 if(jQuery(this).parent().hasClass("active")) { 848 jQuery(this).parent().removeClass("active").children(".answer").slideToggle(200); 849 } 850 else 851 {
852 if( ! jQuery(this).closest('.mfn-acc').hasClass('toggle') ){ 853 jQuery(this).parents(".mfn-acc").children().each(function() { 854 if(jQuery(this).hasClass("active")) { 855 jQuery(this).removeClass("active").children(".answer").slideToggle(200); 856 } 857 }); 858 } 859 jQuery(this).parent().addClass("active"); 860 jQuery(this).next(".answer").slideToggle(200); 861 } 862 }); 863 864 865 /* --------------------------------------------------------------------------- 866 * jPlayer 867 * --------------------------------------------------------------------------- */ 868 function mfn_jPlayer(){ 869 jQuery('.mfn-jplayer').each(function(){ 870 var m4v = jQuery(this).attr('data-m4v'); 871 var poster = jQuery(this).attr('data-img'); 872 var swfPath = jQuery(this).attr('data-swf'); 873 var cssSelectorAncestor = '#' + jQuery(this).closest('.mfn-jcontainer').attr('id'); 874 875 jQuery(this).jPlayer({ 876 ready : function () { 877 jQuery(this).jPlayer('setMedia', { 878 m4v : m4v, 879 poster : poster 880 }); 881 }, 882 play : function () { // To avoid both jPlayers playing together. 883 jQuery(this).jPlayer('pauseOthers'); 884 }, 885 size: { 886 cssClass : 'jp-video-360p', 887 width : '100%', 888 height : '360px' 889 }, 890 swfPath : swfPath, 891 supplied : 'm4v', 892 cssSelectorAncestor : cssSelectorAncestor, 893 wmode : 'opaque' 894 }); 895 }); 896 } 897 mfn_jPlayer(); 898 899 900 /* --------------------------------------------------------------------------- 901 * Love 902 * --------------------------------------------------------------------------- */ 903 /*jQuery('.mfn-love').click(function() { 904 var el = jQuery(this); 905 if( el.hasClass('loved') ) return false; 906 907 var post = { 908 action: 'mfn_love', 909 post_id: el.attr('data-id') 910 }; 911 912 $.post(window.mfn_ajax, post, function(data){ 913 el.find('.label').html(data); 914 el.addClass('loved'); 915 }); 916 917 return false; 918 }); */ 919 920 921 /* --------------------------------------------------------------------------- 922 * Go to top 923 * --------------------------------------------------------------------------- */ 924 jQuery('#back_to_top').click(function(){ 925 jQuery('body,html').animate({ 926 scrollTop: 0 927 }, 500); 928 return false; 929 }); 930 931 932 /* --------------------------------------------------------------------------- 933 * Section navigation 934 * --------------------------------------------------------------------------- */ 935 jQuery('.section .section-nav').click(function(){ 936 var el = jQuery(this); 937 var section = el.closest('.section'); 938 939 if( el.hasClass('prev') ){ 940 // Previous Section ------------- 941 if( section.prev().length ){ 942 jQuery('html, body').animate({ 943 scrollTop: section.prev().offset().top 944 }, 500); 945 } 946 } else { 947 // Next Section ----------------- 948 if( section.next().length ){ 949 jQuery('html, body').animate({ 950 scrollTop: section.next().offset().top 951 }, 500); 952 } 953 } 954 }); 955 956 957 /* --------------------------------------------------------------------------- 958 * WooCommerce 959 * --------------------------------------------------------------------------- */ 960 function addToCart(){ 961 jQuery('body').on('click', '.add_to_cart_button', function(){ 962 jQuery(this) 963 .closest('.product') 964 .addClass('adding-to-cart') 965 .removeClass('added-to-cart'); 966 }); 967 968 jQuery('body').bind('added_to_cart', function() { 969 jQuery('.adding-to-cart') 970 .removeClass('adding-to-cart') 971 .addClass('added-to-cart'); 972 }); 973 } 974 addToCart(); 975 976 977 /* --------------------------------------------------------------------------- 978 * Iframe height 979 * --------------------------------------------------------------------------- */ 980 function iframeHeight( item, ratio ){ 981 var itemW = item.width(); 982 var itemH = itemW * ratio; 983 if( itemH < 147 ) itemH = 147; 984 item.height(itemH); 985 } 986 987 function iframesHeight(){ 988 iframeHeight(jQuery(".blog_wrapper .post-photo-wrapper .mfn-jplayer, .blog_wrapper .post-photo-wrapper iframe, .post-related .mfn-jplayer, .post-related iframe, .blog_slider_ul .mfn-jplayer, .blog_slider_ul iframe"), 0.78); // blog - list 989 iframeHeight(jQuery(".single-post .single-photo-wrapper .mfn-jplayer, .single-post .single-photo-wrapper iframe" ), 0.4); // blog - single 990 991 iframeHeight(jQuery(".section-portfolio-header .mfn-jplayer, .section-portfolio-header iframe" ), 0.4); // portfolio - single 992 } 993 iframesHeight(); 994 995 996 /* --------------------------------------------------------------------------- 997 * Debouncedresize 998 * --------------------------------------------------------------------------- */ 999 jQuery(window).bind("debouncedresize", function() { 1000 1001 iframesHeight(); 1002 jQuery('.masonry.isotope,.isotope').isotope(); 1003 1004 // carouFredSel wrapper Height set 1005 mfn_carouFredSel_height(); 1006 1007 // Sidebar Height 1008 mfn_sidebar(); 1009 1010 // Sliding Footer | Height 1011 mfn_footer(); 1012 1013 // Header Width 1014 mfn_header(); 1015 1016 // Full Screen Section 1017 mfn_sectionH(); 1018 1019 // niceScroll | Padding right fix for short content 1020 niceScrollFix(); 1021 }); 1022 1023 /* --------------------------------------------------------------------------- 1024 * isotope 1025 * ---------------------------------------------------------------------------
1026 function isotopeFilter( domEl, isoWrapper ){ 1027 var filter = domEl.attr('data-rel'); 1028 isoWrapper.isotope({ filter: filter }); 1029 } 1030 1031 jQuery('.isotope-filters .filters_wrapper').find('li:not(.close) a').click(function(e){ 1032 e.preventDefault(); 1033 isotopeFilter( jQuery(this), jQuery('.isotope') ); 1034 }); 1035 jQuery('.isotope-filters .filters_buttons').find('li.reset a').click(function(e){ 1036 e.preventDefault(); 1037 isotopeFilter( jQuery(this), jQuery('.isotope') ); 1038 }); 1039 1040 // carouFredSel wrapper | Height 1041 mfn_carouFredSel_height(); 1042 1043 // Sidebar | Height 1044 mfn_sidebar(); 1045 1046 // Sliding Footer | Height 1047 mfn_footer(); 1048 1049 // Header | Width 1050 mfn_header(); 1051 1052 // Full Screen Section 1053 mfn_sectionH(); 1054 1055 // Navigation | Hash 1056 hashNav(); 1057 }); 1058 */ 1059 1060 /* --------------------------------------------------------------------------- 1061 * Isotope 1062 * --------------------------------------------------------------------------- */ 1063 1064 // Isotope | Fiters 1065 function isotopeFilter( domEl, isoWrapper ){ 1066 var filter = domEl.attr('data-rel'); 1067 isoWrapper.isotope({ filter: filter }); 1068 } 1069 1070 // Isotope | Fiters | Click 1071 jQuery('.isotope-filters .filters_wrapper').find('li:not(.close) a').click(function(e){ 1072 e.preventDefault(); 1073 1074 var filters = jQuery(this).closest('.isotope-filters'); 1075 var parent = filters.attr('data-parent'); 1076 1077 if( parent ){ 1078 parent = filters.closest( '.' + parent ); 1079 var isoWrapper = parent.find('.isotope').first() 1080 } else { 1081 var isoWrapper = jQuery('.isotope'); 1082 } 1083 1084 filters.find('li').removeClass('current-cat'); 1085 jQuery(this).closest('li').addClass('current-cat'); 1086 1087 isotopeFilter( jQuery(this), isoWrapper ); 1088 }); 1089 1090 1091 // Isotope | Fiters | Reset 1092 jQuery('.isotope-filters .filters_buttons').find('li.reset a').click(function(e){ 1093 e.preventDefault(); 1094 1095 jQuery('.isotope-filters .filters_wrapper').find('li').removeClass('current-cat'); 1096 isotopeFilter( jQuery(this), jQuery('.isotope') ); 1097 }); 1098 1099 1100 // carouFredSel wrapper | Height 1101 mfn_carouFredSel_height(); 1102 1103 // Sidebar | Height 1104 mfn_sidebar(); 1105 1106 // Sliding Footer | Height 1107 mfn_footer(); 1108 1109 // Header | Width 1110 mfn_header(); 1111 1112 // Full Screen Section 1113 mfn_sectionH(); 1114 1115 // Navigation | Hash 1116 hashNav(); 1117 1118 // Equal Columns | Height 1119 //mfn_equalH(); 1120 }); 1121 1122 /* -------------------------------------------------------------------------------------------------------------------------- 1123 * jQuery(window).scroll 1124 * ----------------------------------------------------------------------------------------------------------------------- */ 1125 jQuery(window).scroll(function(){ 1126 1127 mfn_stickyH(); 1128 1129 mfn_sticky(); 1130 onePageActive(); 1131 }); 1132 1133 1134 /* -------------------------------------------------------------------------------------------------------------------------- 1135 * jQuery(window).load 1136 * ----------------------------------------------------------------------------------------------------------------------- */ 1137 jQuery(window).load(function(){ 1138 1139 1140 1141 /* --------------------------------------------------------------------------- 1142 * Isotope 1143 * --------------------------------------------------------------------------- */ 1144 // Portfolio - Isotope 1145 jQuery('.portfolio_wrapper .isotope:not(.masonry-flat)').isotope({ 1146 itemSelector : '.portfolio-item', 1147 layoutMode : 'fitRows' 1148 }); 1149 1150 // Portfolio - Masonry Flat 1151 jQuery('.portfolio_wrapper .masonry-flat').isotope({ 1152 itemSelector : '.portfolio-item', 1153 masonry : { 1154 columnWidth: 1 1155 } 1156 }); 1157 1158 // Blog & Portfolio - Masonry 1159 jQuery('.masonry.isotope').isotope({ 1160 itemSelector : '.isotope-item', 1161 layoutMode : 'masonry' 1162 }); 1163 1164 1165 /* --------------------------------------------------------------------------- 1166 * Chart 1167 * --------------------------------------------------------------------------- */ 1168 jQuery('.chart').waypoint({ 1169 offset : '100%', 1170 triggerOnce : true, 1171 handler : function(){ 1172 var color = jQuery(this).attr('data-color'); 1173 jQuery(this).easyPieChart({ 1174 animate : 1000, 1175 barColor : color, 1176 lineCap : 'circle', 1177 lineWidth : 8, 1178 size : 140, 1179 scaleColor : false, 1180 trackColor : '#f8f8f8' 1181 }); 1182 } 1183 }); 1184 1185 1186 /* --------------------------------------------------------------------------- 1187 * Skills 1188 * --------------------------------------------------------------------------- */ 1189 jQuery('.bars_list').waypoint({ 1190 offset : '100%', 1191 triggerOnce : true, 1192 handler : function(){ 1193 jQuery(this).addClass('hover'); 1194 } 1195 }); 1196 1197 1198 /* --------------------------------------------------------------------------- 1199 * Progress Icons 1200 * --------------------------------------------------------------------------- */ 1201 jQuery('.progress_icons').waypoint({ 1202 offset : '100%', 1203 triggerOnce : true, 1204 handler : function(){ 1205 1206 var el = jQuery(this); 1207 var active = el.attr('data-active'); 1208 var color = el.attr('data-color'); 1209 var icon = el.find('.progress_icon'); 1210 var timeout = 200; // timeout in milliseconds 1211 1212 icon.each(function(i){ 1213 if( i < active ){ 1214 var time = (i+1) * timeout; 1215 setTimeout(function(){ 1216 jQuery(icon[i]) 1217 .addClass('themebg') 1218 .css('background-color',color); 1219 },time ); 1220 1221 } 1222 }); 1223 1224 } 1225 }); 1226 1227 1228 /* --------------------------------------------------------------------------- 1229 * Animate Math [counter, quick_fact, etc.] 1230 * --------------------------------------------------------------------------- */ 1231 jQuery('.animate-math .number').waypoint({ 1232 offset : '100%', 1233 triggerOnce : true, 1234 handler : function(){ 1235 var el = jQuery(this); 1236 var duration = Math.floor((Math.random()*1000)+1000); 1237 var to = el.attr('data-to'); 1238 1239 jQuery({property:0}).animate({property:to}, { 1240 duration : duration, 1241 easing :'linear', 1242 step : function() { 1243 el.text(Math.floor(this.property)); 1244 }, 1245 complete : function() { 1246 el.text(this.property); 1247 } 1248 }); 1249 } 1250 }); 1251 1252 1253 // carouFredSel wrapper | Height 1254 mfn_carouFredSel_height(); 1255 1256 // Sidebar | Height 1257 mfn_sidebar(); 1258 1259 // Sliding Footer | Height 1260 mfn_footer(); 1261 1262 // Header | Width 1263 mfn_header(); 1264 1265 // Full Screen Section 1266 mfn_sectionH(); 1267 1268 // Navigation | Hash 1269 hashNav(); 1270 1271 // niceScroll | Padding right fix for short content 1272 niceScrollFix(); 1273 }); 1274 1275 1276 /* -------------------------------------------------------------------------------------------------------------------------- 1277 * jQuery(document).mouseup 1278 * ----------------------------------------------------------------------------------------------------------------------- */ 1279 jQuery(document).mouseup(function(e){ 1280 1281 // search 1282 if( jQuery("#searchform").has(e.target).length === 0 ){ 1283 if( jQuery("#searchform").hasClass('focus') ){ 1284 jQuery(this).find('.icon_close').click(); 1285 } 1286 } 1287 1288 }); 1289 1290 1291 /* --------------------------------------------------------------------------- 1292 * Sliders configuration 1293 * --------------------------------------------------------------------------- */ 1294 1295 // carouFredSel wrapper Height set ------------------------------------------- 1296 function mfn_carouFredSel_height(){ 1297 jQuery('.caroufredsel_wrapper > ul').each(function(){ 1298 var el = jQuery(this); 1299 var maxH = 0; 1300 el.children('li').each(function(){ 1301 if( jQuery(this).innerHeight() > maxH ){ 1302 maxH = jQuery(this).innerHeight(); 1303 } 1304 });
1305// console.log(maxH); 1306 el.closest('.caroufredsel_wrapper').height( maxH ); 1307 }); 1308 1309 } 1310 1311 // --- Slider ---------------------------------------------------------------- 1312function mfnSliderContent(){ 1313 jQuery('.content_slider_ul').each(function(){ 1314 1315 if( jQuery(this).closest('.content_slider').hasClass('carousel') ){ 1316 var style = { min:1, max:6}; 1317 } else { 1318 var style = 1; 1319 } 1320 1321 // Init carouFredSel 1322 jQuery( this ).carouFredSel({ 1323 circular : true, 1324 responsive : true, 1325 items : { 1326 width : 380, 1327 visible : style 1328 }, 1329 scroll : { 1330 duration : 500, 1331 easing : 'swing' 1332 }, 1333 prev : { 1334 button : function(){ 1335 return jQuery(this).closest('.content_slider').find('.slider_prev'); 1336 } 1337 }, 1338 next : { 1339 button : function(){ 1340 return jQuery(this).closest('.content_slider').find('.slider_next'); 1341 } 1342 }, 1343 pagination : { 1344 container : function(){ 1345 return jQuery(this).closest('.content_slider').find('.slider_pagination'); 1346 } 1347 }, 1348 auto : { 1349 play : window.mfn_sliders.slider ? true : false, 1350 timeoutDuration : window.mfn_sliders.slider ? window.mfn_sliders.slider : 2500, 1351 }, 1352 swipe : { 1353 onTouch : true, 1354 onMouse : true, 1355 onBefore : function(){ 1356 jQuery(this).find('a').addClass('disable'); 1357 jQuery(this).find('li').trigger('mouseleave'); 1358 }, 1359 onAfter : function(){ 1360 jQuery(this).find('a').removeClass('disable'); 1361 } 1362 } 1363 }); 1364 1365 // Disable accidental clicks while swiping 1366 jQuery(this).on('click', 'a.disable', function() { 1367 return false; 1368 }); 1369 }); 1370 } 1371 1372 1373 1374 // --- Testimonials ---------------------------------------------------------------- 1375 function mfnSliderTestimonials(){ 1376 jQuery('.testimonials_slider_ul').each(function(){ 1377 1378 // Init carouFredSel 1379 jQuery(this).carouFredSel({ 1380 circular : true, 1381 responsive : true, 1382 items : { 1383 visible : 1, 1384 width : 100 1385 }, 1386 scroll : { 1387 duration : 500, 1388 easing : 'swing' 1389 }, 1390 prev : { 1391 button : function(){ 1392 return jQuery(this).closest('.testimonials_slider').find('.slider_prev'); 1393 } 1394 }, 1395 next : { 1396 button : function(){ 1397 return jQuery(this).closest('.testimonials_slider').find('.slider_next'); 1398 } 1399 }, 1400 pagination : { 1401 container : function(){ 1402 return jQuery(this).closest('.testimonials_slider').find('.slider_pager'); 1403 }, 1404 anchorBuilder : false 1405 }, 1406 auto : { 1407 play : window.mfn_sliders.testimonials ? true : false, 1408 timeoutDuration : window.mfn_sliders.testimonials ? window.mfn_sliders.testimonials : 2500, 1409 }, 1410 swipe : { 1411 onTouch : true, 1412 onMouse : true, 1413 onBefore : function(){ 1414 jQuery(this).find('a').addClass('disable'); 1415 jQuery(this).find('li').trigger('mouseleave'); 1416 }, 1417 onAfter : function(){ 1418 jQuery(this).find('a').removeClass('disable'); 1419 } 1420 } 1421 }); 1422 1423 // Disable accidental clicks while swiping 1424 jQuery(this).on('click', 'a.disable', function() { 1425 return false; 1426 }); 1427 }); 1428 } 1429 1430 1431 // --- Offer ----------------------------------------------------------------- 1432 function mfnSliderOffer(){ 1433 jQuery('.offer_ul').each(function(){ 1434 1435 // Init carouFredSel 1436 jQuery(this).carouFredSel({ 1437 circular : true, 1438 responsive : true, 1439 items : { 1440 visible : 1, 1441 width : 100 1442 }, 1443 scroll : { 1444 duration : 500, 1445 easing : 'swing', 1446 onAfter : function(){ 1447 jQuery(this).closest('.offer').find('.current').text(jQuery(this).triggerHandler("currentPosition")+1); 1448 } 1449 }, 1450 prev : { 1451 button : function(){ 1452 return jQuery(this).closest('.offer').find('.slider_prev'); 1453 } 1454 }, 1455 next : { 1456 button : function(){ 1457 return jQuery(this).closest('.offer').find('.slider_next'); 1458 } 1459 }, 1460 auto : { 1461 play : window.mfn_sliders.offer ? true : false, 1462 timeoutDuration : window.mfn_sliders.offer ? window.mfn_sliders.offer : 2500, 1463 }, 1464 swipe : { 1465 onTouch : true, 1466 onMouse : true, 1467 onBefore : function(){ 1468 jQuery(this).find('a').addClass('disable'); 1469 jQuery(this).find('li').trigger('mouseleave'); 1470 }, 1471 onAfter : function(){ 1472 jQuery(this).find('a').removeClass('disable'); 1473 jQuery(this).closest('.offer').find('.current').text(jQuery(this).triggerHandler("currentPosition")+1); 1474 } 1475 } 1476 }); 1477 1478 // Disable accidental clicks while swiping 1479 jQuery(this).on('click', 'a.disable', function() { 1480 return false; 1481 }); 1482 1483 // Items count 1484 var count = jQuery(this).children('.offer_li').length; 1485 jQuery(this).closest('.offer').find('.count').text(count); 1486 }); 1487 } 1488 1489 1490 // --- Offer Thumb ----------------------------------------------------------------- 1491 function mfnSliderOfferThumb_Pager(nr) { 1492 var thumb = jQuery('.offer_thumb').find('.offer_thumb_li:eq('+ (nr-1) +') .thumbnail img').attr('src'); 1493 return '<a href="#'+ nr +'"><img src="'+ thumb +'" alt="'+ nr +'" /></a>'; 1494 } 1495 1496 function mfnSliderOfferThumb(){ 1497 jQuery('.offer_thumb_ul').each(function(){ 1498 1499 // Init carouFredSel 1500 jQuery(this).carouFredSel({ 1501 circular : true, 1502 responsive : true, 1503 items : { 1504 visible : 1, 1505 width : 100 1506 }, 1507 pagination : { 1508 container : jQuery(this).closest('.offer_thumb').find('.slider_pagination'), 1509 anchorBuilder : mfnSliderOfferThumb_Pager 1510 }, 1511 scroll : { 1512 duration : 500, 1513 easing : 'swing', 1514 onAfter : function(){ 1515 jQuery(this).closest('.offer_thumb').find('.current').text(jQuery(this).triggerHandler("currentPosition")+1); 1516 } 1517 }, 1518 auto : { 1519 play : window.mfn_sliders.offer ? true : false, 1520 timeoutDuration : window.mfn_sliders.offer ? window.mfn_sliders.offer : 2500, 1521 }, 1522 swipe : { 1523 onTouch : true, 1524 onMouse : true, 1525 onBefore : function(){ 1526 jQuery(this).find('a').addClass('disable'); 1527 jQuery(this).find('li').trigger('mouseleave'); 1528 }, 1529 onAfter : function(){ 1530 jQuery(this).find('a').removeClass('disable'); 1531 jQuery(this).closest('.offer_thumb').find('.current').text(jQuery(this).triggerHandler("currentPosition")+1); 1532 } 1533 } 1534 }); 1535 1536 // Disable accidental clicks while swiping 1537 jQuery(this).on('click', 'a.disable', function() { 1538 return false; 1539 }); 1540 }); 1541 } 1542 1543 1544 // --- Blog ------------------------------------------------------------------ 1545 function mfnSliderBlog(){ 1546 jQuery('.blog_slider_ul').each(function(){ 1547 1548 // Init carouFredSel 1549 jQuery(this).carouFredSel({ 1550 circular : true, 1551 responsive : true, 1552 items : { 1553 width : 380, 1554 visible : { 1555 min : 1, 1556 max : 4 1557 } 1558 }, 1559 scroll : { 1560 duration : 500, 1561 easing : 'swing' 1562 }, 1563 prev : { 1564 button : function(){ 1565 return jQuery(this).closest('.blog_slider').find('.slider_prev'); 1566 } 1567 }, 1568 next : { 1569 button : function(){ 1570 return jQuery(this).closest('.blog_slider').find('.slider_next'); 1571 } 1572 }, 1573 pagination : { 1574 container : function(){ 1575 return jQuery(this).closest('.blog_slider').find('.slider_pagination'); 1576 } 1577 }, 1578 auto : { 1579 play : window.mfn_sliders.blog ? true : false, 1580 timeoutDuration : window.mfn_sliders.blog ? window.mfn_sliders.blog : 2500, 1581 }, 1582 swipe : { 1583 onTouch : true, 1584 onMouse : true, 1585 onBefore : function(){ 1586 jQuery(this).find('a').addClass('disable'); 1587 jQuery(this).find('li').trigger('mouseleave'); 1588 }, 1589 onAfter : function(){ 1590 jQuery(this).find('a').removeClass('disable'); 1591 } 1592 } 1593 }); 1594 1595 // Disable accidental clicks while swiping 1596 jQuery(this).on('click', 'a.disable', function() { 1597 return false; 1598 }); 1599 }); 1600 } 1601 1602 1603 // --- Clients ------------------------------------------------------------------ 1604 function mfnSliderClients(){ 1605 jQuery('.clients_slider_ul').each(function(){ 1606 1607 // Init carouFredSel 1608 jQuery(this).carouFredSel({ 1609 circular : true, 1610 responsive : true, 1611 items : { 1612 width : 380, 1613 visible : { 1614 min : 1, 1615 max : 4 1616 } 1617 }, 1618 scroll : { 1619 duration : 500, 1620 easing : 'swing' 1621 }, 1622 prev : { 1623 button : function(){ 1624 return jQuery(this).closest('.clients_slider').find('.slider_prev'); 1625 } 1626 }, 1627 next : { 1628 button : function(){ 1629 return jQuery(this).closest('.clients_slider').find('.slider_next'); 1630 } 1631 }, 1632 pagination : { 1633 container : function(){ 1634 return jQuery(this).closest('.clients_slider').find('.slider_pagination'); 1635 } 1636 }, 1637 auto : { 1638 play : window.mfn_sliders.clients ? true : false, 1639 timeoutDuration : window.mfn_sliders.clients ? window.mfn_sliders.clients : 2500, 1640 }, 1641 swipe : { 1642 onTouch : true, 1643 onMouse : true, 1644 onBefore : function(){ 1645 jQuery(this).find('a').addClass('disable'); 1646 jQuery(this).find('li').trigger('mouseleave'); 1647 }, 1648 onAfter : function(){ 1649 jQuery(this).find('a').removeClass('disable'); 1650 } 1651 } 1652 }); 1653 1654 // Disable accidental clicks while swiping 1655 jQuery(this).on('click', 'a.disable', function() { 1656 return false; 1657 }); 1658 }); 1659 } 1660 1661 1662 // --- Shop ------------------------------------------------------------------ 1663 function mfnSliderShop(){ 1664 jQuery('.shop_slider_ul').each(function(){ 1665 1666 // Init carouFredSel 1667 jQuery(this).carouFredSel({ 1668 circular : true, 1669 responsive : true, 1670 items : { 1671 width : 380, 1672 visible : { 1673 min : 1, 1674 max : 4 1675 } 1676 }, 1677 scroll : { 1678 duration : 500, 1679 easing : 'swing' 1680 }, 1681 prev : { 1682 button : function(){ 1683 return jQuery(this).closest('.shop_slider').find('.slider_prev'); 1684 } 1685 }, 1686 next : { 1687 button : function(){ 1688 return jQuery(this).closest('.shop_slider').find('.slider_next'); 1689 } 1690 }, 1691 pagination : { 1692 container : function(){ 1693 return jQuery(this).closest('.shop_slider').find('.slider_pagination'); 1694 } 1695 }, 1696 auto : { 1697 play : window.mfn_sliders.shop ? true : false, 1698 timeoutDuration : window.mfn_sliders.shop ? window.mfn_sliders.shop : 2500, 1699 }, 1700 swipe : { 1701 onTouch : true, 1702 onMouse : true, 1703 onBefore : function(){ 1704 jQuery(this).find('a').addClass('disable'); 1705 jQuery(this).find('li').trigger('mouseleave'); 1706 }, 1707 onAfter : function(){ 1708 jQuery(this).find('a').removeClass('disable'); 1709 } 1710 } 1711 }); 1712 1713 // Disable accidental clicks while swiping 1714 jQuery(this).on('click', 'a.disable', function() { 1715// return false; 1716 }); 1717 }); 1718 } 1719 1720 1721 // --- Portfolio ------------------------------------------------------------- 1722 function mfnSliderPortfolio(){ 1723 jQuery('.portfolio_slider_ul').each(function(){ 1724 1725 // Init carouFredSel 1726 jQuery(this).carouFredSel({ 1727 circular : true, 1728 responsive : true, 1729 items : { 1730 width : 380, 1731 visible : { 1732 min : 1, 1733 max : 5 1734 } 1735 }, 1736 scroll : { 1737 duration : 600, 1738 easing : 'swing' 1739 }, 1740 prev : { 1741 button : function(){ 1742 return jQuery(this).closest('.portfolio_slider').find('.slider_prev'); 1743 } 1744 }, 1745 next : { 1746 button : function(){ 1747 return jQuery(this).closest('.portfolio_slider').find('.slider_next'); 1748 } 1749 }, 1750 auto : { 1751 play : window.mfn_sliders.portfolio ? true : false, 1752 timeoutDuration : window.mfn_sliders.portfolio ? window.mfn_sliders.portfolio : 2500, 1753 }, 1754 swipe : { 1755 onTouch : true, 1756 onMouse : true, 1757 onBefore : function(){ 1758 jQuery(this).find('a').addClass('disable'); 1759 jQuery(this).find('li').trigger('mouseleave'); 1760 }, 1761 onAfter : function(){ 1762 jQuery(this).find('a').removeClass('disable'); 1763 } 1764 } 1765 }); 1766 1767 // Disable accidental clicks while swiping 1768 jQuery(this).on('click', 'a.disable', function() { 1769 return false; 1770 }); 1771 }); 1772 } 1773 1774window.mfn_nicescroll = 25; 1775 window.mfn_prettyphoto = { 1776 disable : 0, 1777 width : 0, 1778 height : 0 1779 }; 1780 window.mfn_sliders = { 1781 blog : 0, 1782 clients : 0, 1783 offer : 10000, 1784 portfolio : 0, 1785 shop : 0, 1786 slider : 6000, 1787 testimonials : 7000 1788 1789 }; 1790 1791 1792 1793 1794 jQuery(document).ready(function($) { 1795 jQuery('.masonry.isotope,.isotope').isotope(); 1796 1797 jQuery('#configurator .control').click(function(e) { 1798 e.preventDefault(); 1799 if (jQuery('#configurator').hasClass('active')) { 1800 jQuery('#configurator').removeClass('active').animate({ 1801 'right' : -272 1802 }, 500); 1803 } else { 1804 jQuery('#configurator').addClass('active').animate({ 1805 'right' : -1 1806 }, 500); 1807 } 1808 });
1809 jQuery('#mfn-demo-panel .control').click(function(e) { 1810 e.preventDefault(); 1811 if (jQuery('#mfn-demo-panel').hasClass('active')) { 1812 jQuery('#mfn-demo-panel').removeClass('active').animate({ 1813 'right' : -367 1814 }, 500); 1815 } else { 1816 jQuery('#mfn-demo-panel').addClass('active').animate({ 1817 'right' : -1 1818 }, 500); 1819 } 1820 }); 1821 1822 demosSliderH(); 1823 /* --------------------------------------------------------------------------- 1824 * niceScroll 1825 * --------------------------------------------------------------------------- */ 1826 jQuery(".demos-slider").niceScroll({ 1827 autohidemode : false, 1828 cursorborder : 0, 1829 cursorborderradius : 5, 1830 cursorcolor : '#222222', 1831 cursorwidth : 0, 1832 horizrailenabled : false, 1833 mousescrollstep : 40, 1834 scrollspeed : 60 1835 }); 1836 1837 1838 /* --------------------------------------------------------------------------- 1839 * Paralex Backgrounds 1840 * --------------------------------------------------------------------------- */ 1841 if (typeof stellar !== 'undefined' && $.isFunction(stellar)) { 1842 var ua = navigator.userAgent, 1843 isMobileWebkit = /WebKit/.test(ua) && /Mobile/.test(ua); 1844 1845 if( ! isMobileWebkit && jQuery(window).width() >= 768 ){ 1846 1847 if( window.mfn_parallax == 'stellar' ){ 1848 1849 // Stellar 1850 jQuery.stellar({ 1851 horizontalScrolling : false, 1852 responsive : true 1853 }); 1854 1855 } else { 1856 1857 // Enllax 1858 jQuery(window).enllax(); 1859 1860 } 1861 1862 } else { 1863 1864 jQuery('.section[data-enllax-ratio], .section[data-stellar-ratio]').css( 'background-attachment' , 'scroll' ); 1865 1866 } 1867 } 1868 1869 1870 1871 1872 }); 1873 1874 1875})(jQuery); 1876 1877 function demosSliderH(){ 1878 var panel = jQuery('#mfn-demo-panel'); 1879 var panelH = panel.height() - panel.find('.header').height(); 1880 jQuery(".demos-slider").height(panelH); 1881 }
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.