1var THEMEMASCOT = {}; 2 3(function ($) { 4 "use strict"; 5 6 /* ---------------------------------------------------------------------- */ 7 /* -------------------------- Declare Variables ------------------------- */ 8 /* ---------------------------------------------------------------------- */ 9 var $document = $(document); 10 var $document_body = $(document.body); 11 var $window = $(window); 12 var $html = $('html'); 13 var $body = $('body'); 14 var $wrapper = $('#wrapper'); 15 var $header = $('#header'); 16 var $footer = $('#footer'); 17 var $sections = $('section'); 18 var $portfolio_gallery = $(".gallery-isotope"); 19 var portfolio_filter = ".portfolio-filter a"; 20 var $portfolio_filter_first_child = $(".portfolio-filter a:eq(0)"); 21 var $portfolio_flex_slider = $(".portfolio-slider"); 22 23 24 THEMEMASCOT.isMobile = { 25 Android: function () { 26 return navigator.userAgent.match(/Android/i); 27 }, 28 BlackBerry: function () { 29 return navigator.userAgent.match(/BlackBerry/i); 30 }, 31 iOS: function () { 32 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 33 }, 34 Opera: function () { 35 return navigator.userAgent.match(/Opera Mini/i); 36 }, 37 Windows: function () { 38 return navigator.userAgent.match(/IEMobile/i); 39 }, 40 any: function () { 41 return (THEMEMASCOT.isMobile.Android() || THEMEMASCOT.isMobile.BlackBerry() || THEMEMASCOT.isMobile.iOS() || THEMEMASCOT.isMobile.Opera() || THEMEMASCOT.isMobile.Windows()); 42 } 43 }; 44 45 THEMEMASCOT.isRTL = { 46 check: function () { 47 if ($("html").attr("dir") == "rtl") { 48 return true; 49 } else { 50 return false; 51 } 52 } 53 }; 54 55 THEMEMASCOT.urlParameter = { 56 get: function (sParam) { 57 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 58 sURLVariables = sPageURL.split('&'), 59 sParameterName, 60 i; 61 62 for (i = 0; i < sURLVariables.length; i++) { 63 sParameterName = sURLVariables[i].split('='); 64 65 if (sParameterName[0] === sParam) { 66 return sParameterName[1] === undefined ? true : sParameterName[1]; 67 } 68 } 69 } 70 }; 71 72 73 THEMEMASCOT.bmiCalculator = { 74 magic: function (bmi) { 75 var output = ''; 76 var info = ''; 77 if (bmi) { 78 if (bmi < 15) { 79 info = "very severely underweight"; 80 } 81 if ((bmi >= 15) && (bmi < 16)) { 82 info = "severely underweight"; 83 } 84 if ((bmi >= 16) && (bmi < 18.5)) { 85 info = "underweight"; 86 } 87 if ((bmi >= 18.5) && (bmi < 25)) { 88 info = "normal"; 89 } 90 if ((bmi >= 25) && (bmi < 30)) { 91 info = "overweight"; 92 } 93 if ((bmi >= 30) && (bmi < 35)) { 94 info = "moderately obese"; 95 } 96 if ((bmi >= 35) && (bmi <= 40)) { 97 info = "severely obese"; 98 } 99 if (bmi > 40) { 100 info = "very severely obese"; 101 } 102 output = "Your BMI is <span>" + bmi + "</span><br />" + 103 "You are <span>" + info + "</span>."; 104 } else { 105 output = "You broke it!"; 106 }; 107 return output; 108 }, 109 110 calculateStandard: function (bmi_form) { 111 var weight_lbs = bmi_form.find('input[name="bmi_standard_weight_lbs"]').val(); 112 var height_ft = bmi_form.find('input[name="bmi_standard_height_ft"]').val(); 113 var height_in = bmi_form.find('input[name="bmi_standard_height_in"]').val(); 114 var age = bmi_form.find('input[name="bmi_standard_age"]').val(); 115 var gender = bmi_form.find('radio[name="bmi_standard_gender"]').val(); 116
117 var total_height_inc = (parseInt(height_ft, 10) * 12) + parseInt(height_in, 10); 118 var bmi = (parseFloat(weight_lbs) / (total_height_inc * total_height_inc)) * 703; 119 var output = THEMEMASCOT.bmiCalculator.magic(bmi); 120 121 bmi_form.find('#bmi_standard_calculator_form_result').html(output).fadeIn('slow'); 122 }, 123 124 calculateMetric: function (bmi_form) { 125 var weight_kg = bmi_form.find('input[name="bmi_metric_weight_kg"]').val(); 126 var height_cm = bmi_form.find('input[name="bmi_metric_height_cm"]').val(); 127 var age = bmi_form.find('input[name="bmi_standard_age"]').val(); 128 var gender = bmi_form.find('radio[name="bmi_standard_gender"]').val(); 129 130 var total_weight_kg = parseFloat(weight_kg); 131 var total_height_m = parseFloat(height_cm) * 0.01; 132 var bmi = (total_weight_kg / (total_height_m * total_height_m)); 133 var output = THEMEMASCOT.bmiCalculator.magic(bmi); 134 135 bmi_form.find('#bmi_metric_calculator_form_result').html(output).fadeIn('slow'); 136 }, 137 138 init: function () { 139 var bmi_Standard_Form = $('#form_bmi_standard_calculator'); 140 bmi_Standard_Form.on('submit', function (e) { 141 e.preventDefault(); 142 THEMEMASCOT.bmiCalculator.calculateStandard(bmi_Standard_Form); 143 return false; 144 }); 145 146 var bmi_Metric_Form = $('#form_bmi_metric_calculator'); 147 bmi_Metric_Form.on('submit', function (e) { 148 e.preventDefault(); 149 THEMEMASCOT.bmiCalculator.calculateMetric(bmi_Metric_Form); 150 return false; 151 }); 152 } 153 154 }; 155 156 THEMEMASCOT.initialize = { 157 158 init: function () { 159 THEMEMASCOT.bmiCalculator.init(); 160 THEMEMASCOT.initialize.TM_fixedFooter(); 161 THEMEMASCOT.initialize.TM_datePicker(); 162 THEMEMASCOT.initialize.TM_ddslick(); 163 THEMEMASCOT.initialize.TM_sliderRange(); 164 THEMEMASCOT.initialize.TM_loadBSParentModal(); 165 THEMEMASCOT.initialize.TM_demoSwitcher(); 166 THEMEMASCOT.initialize.TM_platformDetect(); 167 THEMEMASCOT.initialize.TM_onLoadPopupPromoBox(); 168 THEMEMASCOT.initialize.TM_customDataAttributes(); 169 THEMEMASCOT.initialize.TM_parallaxBgInit(); 170 THEMEMASCOT.initialize.TM_resizeFullscreen(); 171 THEMEMASCOT.initialize.TM_prettyPhoto_lightbox(); 172 THEMEMASCOT.initialize.TM_nivolightbox(); 173 THEMEMASCOT.initialize.TM_fitVids(); 174 THEMEMASCOT.initialize.TM_YTPlayer(); 175 THEMEMASCOT.initialize.TM_equalHeightDivs(); 176 }, 177 178 /* ---------------------------------------------------------------------- */ 179 /* ------------------------------ Fixed Footer ------------------------- */ 180 /* ---------------------------------------------------------------------- */ 181 TM_fixedFooter: function () { 182 var $fixed_footer = $('.fixed-footer'); 183 184 if ($fixed_footer.length > 0) { 185 $('body.has-fixed-footer .main-content').css('margin-bottom', $fixed_footer.height()); 186 } 187 }, 188 189 /* ---------------------------------------------------------------------- */ 190 /* ------------------------------ Date Picker -------------------------- */ 191 /* ---------------------------------------------------------------------- */ 192 TM_datePicker: function () { 193 $(".date-picker").datepicker(); 194 $(".time-picker").timepicker(); 195 $(".datetime-picker").datetimepicker(); 196 }, 197 198 /* ---------------------------------------------------------------------- */ 199 /* -------------------------------- ddslick ---------------------------- */ 200 /* ---------------------------------------------------------------------- */ 201 TM_ddslick: function () { 202 var $ddslick = $("select.ddslick"); 203 if ($ddslick.length > 0) { 204 $ddslick.each(function () { 205 var name = $(this).attr('name'); 206 var id = $(this).attr('id'); 207 $("#" + id).ddslick({ 208 width: '100%', 209 imagePosition: "left", 210 onSelected: function (selectedData) { 211 $("#" + id + " .dd-selected-value").prop('name', name); 212 } 213 }); 214 }); 215 } 216 }, 217 218 /* ---------------------------------------------------------------------- */ 219 /* ----------------------------- slider range -------------------------- */ 220 /* ---------------------------------------------------------------------- */ 221 TM_sliderRange: function () { 222 var $slider_range = $(".slider-range"); 223 if ($slider_range.length > 0) { 224 $slider_range.each(function () { 225 var id = $(this).attr('id'); 226 var target_id = $(this).data('target'); 227 $("#" + target_id).slider({ 228 range: "max", 229 min: 2001, 230 max: 2016, 231 value: 2010, 232 slide: function (event, ui) { 233 $("#" + id).val(ui.value); 234 } 235 }); 236 $("#" + id).val($("#" + target_id).slider("value")); 237 }); 238 } 239 }, 240 241 /* ---------------------------------------------------------------------- */ 242 /* ------------------------ Bootstrap Parent Modal --------------------- */ 243 /* ---------------------------------------------------------------------- */
244 TM_loadBSParentModal: function () { 245 var ajaxLoadContent = false; 246 if (ajaxLoadContent) { 247 $.ajax({ 248 url: "ajax-load/bootstrap-parent-modal.html", 249 success: function (data) { 250 $body.append(data); 251 }, 252 dataType: 'html' 253 }); 254 } 255 }, 256 /* ---------------------------------------------------------------------- */ 257 /* ------------------------------ Demo Switcher ------------------------ */ 258 /* ---------------------------------------------------------------------- */ 259 TM_demoSwitcher: function () { 260 var showSwitcher = false; 261 var $style_switcher = $('#style-switcher'); 262 if (!$style_switcher.length && showSwitcher) { 263 $.ajax({ 264 url: "color-switcher/style-switcher.html", 265 success: function (data) { 266 $body.append(data); 267 }, 268 dataType: 'html' 269 }); 270 } 271 }, 272 273 /* ---------------------------------------------------------------------- */ 274 /* ------------------------------ Preloader ---------------------------- */ 275 /* ---------------------------------------------------------------------- */ 276 TM_preLoaderClickDisable: function () { 277 var $preloader = $('#preloader'); 278 $preloader.children('#disable-preloader').on('click', function (e) { 279 $preloader.fadeOut(); 280 return false; 281 }); 282 }, 283 284 TM_preLoaderOnLoad: function () { 285 var $preloader = $('#preloader'); 286 if ($preloader.length > 0) { 287 $preloader.delay(200).fadeOut('slow'); 288 } 289 }, 290 291 292 /* ---------------------------------------------------------------------- */ 293 /* ------------------------------- Platform detect --------------------- */ 294 /* ---------------------------------------------------------------------- */ 295 TM_platformDetect: function () { 296 if (THEMEMASCOT.isMobile.any()) { 297 $html.addClass("mobile"); 298 } else { 299 $html.addClass("no-mobile"); 300 } 301 }, 302 303 /* ---------------------------------------------------------------------- */ 304 /* ------------------------------ Popup Promo Box ---------------------- */ 305 /* ---------------------------------------------------------------------- */ 306 TM_onLoadPopupPromoBox: function () { 307 var $modal = $('.on-pageload-popup-promobox'); 308 if ($modal.length > 0) { 309 $modal.each(function () { 310 var $current_item = $(this); 311 var target = $current_item.data('target'); 312 var timeout = $current_item.data('timeout'); 313 314 var delay = $current_item.data('delay'); 315 delay = (!delay) ? 2500 : Number(delay) + 2500; 316 317 if ($current_item.hasClass('cookie-enabled')) { 318 var elementCookie = $.cookie(target); 319 if (!!elementCookie && elementCookie == 'enabled') { 320 return true; 321 } 322 } else { 323 $.removeCookie(target); 324 } 325 326 var t_enablepopup = setTimeout(function () { 327 $.magnificPopup.open({ 328 items: { 329 src: target 330 }, 331 type: 'inline', 332 mainClass: 'mfp-no-margins mfp-fade', 333 closeBtnInside: false, 334 fixedContentPos: true, 335 removalDelay: 500, 336 callbacks: { 337 afterClose: function () { 338 if ($current_item.hasClass('cookie-enabled')) { 339 $.cookie(target, 'enabled'); 340 } 341 } 342 } 343 }, 0); 344 }, Number(delay)); 345 346 if (timeout !== '') { 347 var t_closepopup = setTimeout(function () { 348 $.magnificPopup.close(); 349 }, Number(delay) + Number(timeout)); 350 } 351 }); 352 } 353 }, 354 355 /* ---------------------------------------------------------------------- */ 356 /* ------------------------------ Hash Forwarding ---------------------- */ 357 /* ---------------------------------------------------------------------- */ 358 TM_hashForwarding: function () { 359 if (window.location.hash) { 360 var hash_offset = $(window.location.hash).offset(); 361 // var hash_offset = $(window.location.hash).offset().top; 362 $("html, body").animate({ 363 scrollTop: hash_offset 364 }); 365 } 366 }, 367 368 369 /* ---------------------------------------------------------------------- */
370 /* ----------------------- Background image, color ---------------------- */ 371 /* ---------------------------------------------------------------------- */ 372 TM_customDataAttributes: function () { 373 $('[data-bg-color]').each(function () { 374 $(this).css("cssText", "background: " + $(this).data("bg-color") + " !important;"); 375 }); 376 $('[data-bg-img]').each(function () { 377 $(this).css('background-image', 'url(' + $(this).data("bg-img") + ')'); 378 }); 379 $('[data-text-color]').each(function () { 380 $(this).css('color', $(this).data("text-color")); 381 }); 382 $('[data-font-size]').each(function () { 383 $(this).css('font-size', $(this).data("font-size")); 384 }); 385 $('[data-height]').each(function () { 386 $(this).css('height', $(this).data("height")); 387 }); 388 $('[data-border]').each(function () { 389 $(this).css('border', $(this).data("border")); 390 }); 391 $('[data-margin-top]').each(function () { 392 $(this).css('margin-top', $(this).data("margin-top")); 393 }); 394 $('[data-margin-right]').each(function () { 395 $(this).css('margin-right', $(this).data("margin-right")); 396 }); 397 $('[data-margin-bottom]').each(function () { 398 $(this).css('margin-bottom', $(this).data("margin-bottom")); 399 }); 400 $('[data-margin-left]').each(function () { 401 $(this).css('margin-left', $(this).data("margin-left")); 402 }); 403 }, 404 405 406 407 /* ---------------------------------------------------------------------- */ 408 /* -------------------------- Background Parallax ----------------------- */ 409 /* ---------------------------------------------------------------------- */ 410 TM_parallaxBgInit: function () { 411 if (!THEMEMASCOT.isMobile.any() && $window.width() >= 800) { 412 $('.parallax').each(function () { 413 var data_parallax_ratio = ($(this).data("parallax-ratio") === undefined) ? '0.5' : $(this).data("parallax-ratio"); 414 $(this).parallax("50%", data_parallax_ratio); 415 }); 416 } else { 417 $('.parallax').addClass("mobile-parallax"); 418 } 419 }, 420 421 /* ---------------------------------------------------------------------- */ 422 /* --------------------------- Home Resize Fullscreen ------------------- */ 423 /* ---------------------------------------------------------------------- */ 424 TM_resizeFullscreen: function () { 425 var windowHeight = $window.height(); 426 $('.fullscreen, .revslider-fullscreen').height(windowHeight); 427 }, 428 429 /* ---------------------------------------------------------------------- */ 430 /* ----------------------------- Magnific Popup ------------------------- */ 431 /* ---------------------------------------------------------------------- */ 432 TM_magnificPopup_lightbox: function () { 433 434 var $image_popup_lightbox = $('.image-popup-lightbox'); 435 if ($image_popup_lightbox.length > 0) { 436 $image_popup_lightbox.magnificPopup({ 437 type: 'image', 438 closeOnContentClick: true, 439 closeBtnInside: false, 440 fixedContentPos: true, 441 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 442 image: { 443 verticalFit: true 444 } 445 }); 446 } 447 448 var $image_popup_vertical_fit = $('.image-popup-vertical-fit'); 449 if ($image_popup_vertical_fit.length > 0) { 450 $image_popup_vertical_fit.magnificPopup({ 451 type: 'image', 452 closeOnContentClick: true, 453 mainClass: 'mfp-img-mobile', 454 image: { 455 verticalFit: true 456 } 457 }); 458 } 459 460 var $image_popup_fit_width = $('.image-popup-fit-width'); 461 if ($image_popup_fit_width.length > 0) { 462 $image_popup_fit_width.magnificPopup({ 463 type: 'image', 464 closeOnContentClick: true, 465 image: { 466 verticalFit: false 467 } 468 }); 469 } 470 471 var $image_popup_no_margins = $('.image-popup-no-margins'); 472 if ($image_popup_no_margins.length > 0) { 473 $image_popup_no_margins.magnificPopup({ 474 type: 'image', 475 closeOnContentClick: true, 476 closeBtnInside: false, 477 fixedContentPos: true, 478 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 479 image: { 480 verticalFit: true 481 }, 482 zoom: { 483 enabled: true, 484 duration: 300 // don't foget to change the duration also in CSS 485 } 486 }); 487 } 488 489 var $popup_gallery = $('.popup-gallery'); 490 if ($popup_gallery.length > 0) { 491 $popup_gallery.magnificPopup({ 492 delegate: 'a', 493 type: 'image', 494 tLoading: 'Loading image #%curr%...', 495 mainClass: 'mfp-img-mobile', 496 gallery: { 497 enabled: true, 498 navigateByImgClick: true, 499 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 500 }, 501 image: { 502 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 503 titleSrc: function (item) { 504 return item.el.attr('title') + '<small>by Marsel Van Oosten</small>'; 505 } 506 } 507 }); 508 } 509 510 var $zoom_gallery = $('.zoom-gallery'); 511 if ($zoom_gallery.length > 0) { 512 $zoom_gallery.magnificPopup({ 513 delegate: 'li a', 514 type: 'image', 515 closeOnContentClick: false, 516 closeBtnInside: false, 517 mainClass: 'mfp-with-zoom mfp-img-mobile', 518 image: { 519 verticalFit: true, 520 titleSrc: function (item) { 521 return item.el.attr('title') + ' · <a class="image-source-link" href="' + item.el.attr('data-source') + '" target="_blank">image source</a>'; 522 } 523 }, 524 gallery: { 525 enabled: true 526 }, 527 zoom: { 528 enabled: true, 529 duration: 300, // don't foget to change the duration also in CSS 530 opener: function (element) { 531 return element.find('img'); 532 } 533 } 534 535 }); 536 } 537 538 var $popup_yt_vimeo_gmap = $('.popup-youtube, .popup-vimeo, .popup-gmaps'); 539 if ($popup_yt_vimeo_gmap.length > 0) { 540 $popup_yt_vimeo_gmap.magnificPopup({ 541 disableOn: 700, 542 type: 'iframe', 543 mainClass: 'mfp-fade', 544 removalDelay: 160, 545 preloader: false, 546
547 fixedContentPos: false 548 }); 549 } 550 551 var $popup_with_zoom_anim = $('.popup-with-zoom-anim'); 552 if ($popup_with_zoom_anim.length > 0) { 553 $popup_with_zoom_anim.magnificPopup({ 554 type: 'inline', 555 556 fixedContentPos: false, 557 fixedBgPos: true, 558 559 overflowY: 'auto', 560 561 closeBtnInside: true, 562 preloader: false, 563 564 midClick: true, 565 removalDelay: 300, 566 mainClass: 'my-mfp-zoom-in' 567 }); 568 } 569 570 var $popup_with_move_anim = $('.popup-with-move-anim'); 571 if ($popup_with_move_anim.length > 0) { 572 $popup_with_move_anim.magnificPopup({ 573 type: 'inline', 574 575 fixedContentPos: false, 576 fixedBgPos: true, 577 578 overflowY: 'auto', 579 580 closeBtnInside: true, 581 preloader: false, 582 583 midClick: true, 584 removalDelay: 300, 585 mainClass: 'my-mfp-slide-bottom' 586 }); 587 } 588 589 var $ajaxload_popup = $('.ajaxload-popup'); 590 if ($ajaxload_popup.length > 0) { 591 $ajaxload_popup.magnificPopup({ 592 type: 'ajax', 593 alignTop: true, 594 overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump 595 callbacks: { 596 parseAjax: function (mfpResponse) { 597 THEMEMASCOT.initialize.TM_datePicker(); 598 } 599 } 600 }); 601 } 602 603 var $form_ajax_load = $('.form-ajax-load'); 604 if ($form_ajax_load.length > 0) { 605 $form_ajax_load.magnificPopup({ 606 type: 'ajax' 607 }); 608 } 609 610 var $popup_with_form = $('.popup-with-form'); 611 if ($popup_with_form.length > 0) { 612 $popup_with_form.magnificPopup({ 613 type: 'inline', 614 preloader: false, 615 focus: '#name', 616 617 mainClass: 'mfp-no-margins mfp-fade', 618 closeBtnInside: false, 619 fixedContentPos: true, 620 621 // When elemened is focused, some mobile browsers in some cases zoom in 622 // It looks not nice, so we disable it: 623 callbacks: { 624 beforeOpen: function () { 625 if ($window.width() < 700) { 626 this.st.focus = false; 627 } else { 628 this.st.focus = '#name'; 629 } 630 } 631 } 632 }); 633 } 634 635 var $mfpLightboxAjax = $('[data-lightbox="ajax"]'); 636 if ($mfpLightboxAjax.length > 0) { 637 $mfpLightboxAjax.magnificPopup({ 638 type: 'ajax', 639 closeBtnInside: false, 640 callbacks: { 641 ajaxContentAdded: function (mfpResponse) {}, 642 open: function () {}, 643 close: function () {} 644 } 645 }); 646 } 647 648 //lightbox image 649 var $mfpLightboxImage = $('[data-lightbox="image"]'); 650 if ($mfpLightboxImage.length > 0) { 651 $mfpLightboxImage.magnificPopup({ 652 type: 'image', 653 closeOnContentClick: true, 654 closeBtnInside: false, 655 fixedContentPos: true, 656 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 657 image: { 658 verticalFit: true 659 } 660 }); 661 } 662 663 //lightbox gallery 664 var $mfpLightboxGallery = $('[data-lightbox="gallery"]'); 665 if ($mfpLightboxGallery.length > 0) { 666 $mfpLightboxGallery.each(function () { 667 var element = $(this); 668 element.magnificPopup({ 669 delegate: 'a[data-lightbox="gallery-item"]', 670 type: 'image', 671 closeOnContentClick: true, 672 closeBtnInside: false, 673 fixedContentPos: true, 674 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 675 image: { 676 verticalFit: true 677 }, 678 gallery: { 679 enabled: true, 680 navigateByImgClick: true, 681 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 682 }, 683 zoom: { 684 enabled: true, 685 duration: 300, // don't foget to change the duration also in CSS 686 opener: function (element) { 687 return element.find('img'); 688 } 689 } 690 691 }); 692 }); 693 } 694 695 //lightbox iframe 696 var $mfpLightboxIframe = $('[data-lightbox="iframe"]'); 697 if ($mfpLightboxIframe.length > 0) { 698 $mfpLightboxIframe.magnificPopup({ 699 disableOn: 600, 700 type: 'iframe', 701 removalDelay: 160, 702 preloader: false,
703 fixedContentPos: false 704 }); 705 } 706 707 //lightbox inline 708 var $mfpLightboxInline = $('[data-lightbox="inline"]'); 709 if ($mfpLightboxInline.length > 0) { 710 $mfpLightboxInline.magnificPopup({ 711 type: 'inline', 712 mainClass: 'mfp-no-margins mfp-zoom-in', 713 closeBtnInside: false, 714 fixedContentPos: true 715 }); 716 } 717 }, 718 719 /* ---------------------------------------------------------------------- */ 720 /* ----------------------------- lightbox popup ------------------------- */ 721 /* ---------------------------------------------------------------------- */ 722 TM_prettyPhoto_lightbox: function () { 723 //prettyPhoto lightbox 724 var $pretty_photo_lightbox = $("a[data-rel^='prettyPhoto']"); 725 if ($pretty_photo_lightbox.length > 0) { 726 $pretty_photo_lightbox.prettyPhoto({ 727 hook: 'data-rel', 728 animation_speed: 'normal', 729 theme: 'light_square', 730 slideshow: 3000, 731 autoplay_slideshow: false, 732 social_tools: false 733 }); 734 } 735 }, 736 737 /* ---------------------------------------------------------------------- */ 738 /* ------------------------------ Nivo Lightbox ------------------------- */ 739 /* ---------------------------------------------------------------------- */ 740 TM_nivolightbox: function () { 741 var $pretty_photo_lightbox = $('a[data-lightbox-gallery]'); 742 if ($pretty_photo_lightbox.length > 0) { 743 $pretty_photo_lightbox.nivoLightbox({ 744 effect: 'fadeScale' 745 }); 746 } 747 }, 748 749 750 751 /* ---------------------------------------------------------------------- */ 752 /* ---------------------------- Wow initialize ------------------------- */ 753 /* ---------------------------------------------------------------------- */ 754 TM_wow: function () { 755 var wow = new WOW({ 756 mobile: false // trigger animations on mobile devices (default is true) 757 }); 758 wow.init(); 759 }, 760 761 /* ---------------------------------------------------------------------- */ 762 /* ----------------------------- Fit Vids ------------------------------- */ 763 /* ---------------------------------------------------------------------- */ 764 TM_fitVids: function () { 765 $body.fitVids(); 766 }, 767 768 /* ---------------------------------------------------------------------- */ 769 /* ----------------------------- YT Player for Video -------------------- */ 770 /* ---------------------------------------------------------------------- */ 771 TM_YTPlayer: function () { 772 var $ytube_player = $(".player"); 773 if ($ytube_player.length > 0) { 774 $ytube_player.mb_YTPlayer(); 775 } 776 }, 777 778 /* ---------------------------------------------------------------------- */ 779 /* ---------------------------- equalHeights ---------------------------- */ 780 /* ---------------------------------------------------------------------- */ 781 TM_equalHeightDivs: function () { 782 /* equal heigh */ 783 var $equal_height = $('.equal-height'); 784 if ($equal_height.length > 0) { 785 $equal_height.children('div').css('min-height', 'auto'); 786 $equal_height.equalHeights(); 787 } 788 789 /* equal heigh inner div */ 790 var $equal_height_inner = $('.equal-height-inner'); 791 if ($equal_height_inner.length > 0) { 792 $equal_height_inner.children('div').css('min-height', 'auto'); 793 $equal_height_inner.children('div').children('div').css('min-height', 'auto'); 794 $equal_height_inner.equalHeights();
795 $equal_height_inner.children('div').each(function () { 796 $(this).children('div').css('min-height', $(this).css('min-height')); 797 }); 798 } 799 800 /* pricing-table equal heigh*/ 801 var $equal_height_pricing_table = $('.equal-height-pricing-table'); 802 if ($equal_height_pricing_table.length > 0) { 803 $equal_height_pricing_table.children('div').css('min-height', 'auto'); 804 $equal_height_pricing_table.children('div').children('div').css('min-height', 'auto'); 805 $equal_height_pricing_table.equalHeights(); 806 $equal_height_pricing_table.children('div').each(function () { 807 $(this).children('div').css('min-height', $(this).css('min-height')); 808 }); 809 } 810 } 811 812 }; 813 814 815 THEMEMASCOT.header = { 816 817 init: function () { 818 819 var t = setTimeout(function () { 820 THEMEMASCOT.header.TM_fullscreenMenu(); 821 THEMEMASCOT.header.TM_sidePanelReveal(); 822 THEMEMASCOT.header.TM_scroolToTopOnClick(); 823 // THEMEMASCOT.header.TM_scrollToFixed(); 824 THEMEMASCOT.header.TM_topnavAnimate(); 825 THEMEMASCOT.header.TM_scrolltoTarget(); 826 THEMEMASCOT.header.TM_menuzord(); 827 THEMEMASCOT.header.TM_navLocalScorll(); 828 THEMEMASCOT.header.TM_menuCollapseOnClick(); 829 THEMEMASCOT.header.TM_homeParallaxFadeEffect(); 830 THEMEMASCOT.header.TM_topsearch_toggle(); 831 }, 0); 832 833 }, 834 835 836 /* ---------------------------------------------------------------------- */ 837 /* ------------------------- menufullpage ---------------------------- */ 838 /* ---------------------------------------------------------------------- */ 839 TM_fullscreenMenu: function () { 840 var $menufullpage = $('.menu-full-page .fullpage-nav-toggle'); 841 if ($menufullpage.length > 0) { 842 $menufullpage.menufullpage(); 843 } 844 }, 845 846 847 /* ---------------------------------------------------------------------- */ 848 /* ------------------------- Side Push Panel ---------------------------- */ 849 /* ---------------------------------------------------------------------- */ 850 TM_sidePanelReveal: function () { 851 $('.side-panel-trigger').on('click', function (e) { 852 $body.toggleClass("side-panel-open"); 853 if (THEMEMASCOT.isMobile.any()) { 854 $body.toggleClass("overflow-hidden"); 855 } 856 return false; 857 }); 858 859 $('.has-side-panel .body-overlay').on('click', function (e) { 860 $body.toggleClass("side-panel-open"); 861 return false; 862 }); 863 864 //sitebar tree 865 $('.side-panel-nav .nav .tree-toggler').on('click', function (e) { 866 $(this).parent().children('ul.tree').toggle(300); 867 }); 868 }, 869 870 /* ---------------------------------------------------------------------- */ 871 /* ------------------------------- scrollToTop ------------------------- */ 872 /* ---------------------------------------------------------------------- */ 873 TM_scroolToTop: function () { 874 if ($window.scrollTop() > 600) { 875 $('.scrollToTop').fadeIn(); 876 } else { 877 $('.scrollToTop').fadeOut(); 878 } 879 }, 880 881 TM_scroolToTopOnClick: function () { 882 $document_body.on('click', '.scrollToTop', function (e) { 883 $('html, body').animate({ 884 scrollTop: 0 885 }, 800); 886 return false; 887 }); 888 }, 889 890 891 /* ---------------------------------------------------------------------------- */ 892 /* --------------------------- One Page Nav close on click -------------------- */ 893 /* ---------------------------------------------------------------------------- */ 894 TM_menuCollapseOnClick: function () { 895 $document.on('click', '.onepage-nav a', function (e) { 896 $('.showhide').trigger('click'); 897 return false; 898 }); 899 }, 900 901 /* ---------------------------------------------------------------------- */ 902 /* ----------- Active Menu Item on Reaching Different Sections ---------- */ 903 /* ---------------------------------------------------------------------- */ 904 TM_activateMenuItemOnReach: function () { 905 var $onepage_nav = $('.onepage-nav'); 906 var cur_pos = $window.scrollTop() + 2; 907 var nav_height = $onepage_nav.outerHeight(); 908 $sections.each(function () { 909 var top = $(this).offset().top - nav_height - 80, 910 bottom = top + $(this).outerHeight(); 911 912 if (cur_pos >= top && cur_pos <= bottom) { 913 $onepage_nav.find('a').parent().removeClass('current').removeClass('active'); 914 $sections.removeClass('current').removeClass('active'); 915 916 //$(this).addClass('current').addClass('active'); 917 $onepage_nav.find('a[href="#' + $(this).attr('id') + '"]').parent().addClass('current').addClass('active'); 918 } 919 }); 920 }, 921 922 /* ---------------------------------------------------------------------- */ 923 /* ------------------- on click scrool to target with smoothness -------- */ 924 /* ---------------------------------------------------------------------- */ 925 TM_scrolltoTarget: function () { 926 //jQuery for page scrolling feature - requires jQuery Easing plugin 927 $('.smooth-scroll-to-target, .fullscreen-onepage-nav a').on('click', function (e) { 928 e.preventDefault(); 929 930 var $anchor = $(this); 931 932 var $hearder_top = $('.header .header-nav'); 933 var hearder_top_offset = 0; 934 if ($hearder_top[0]) { 935 hearder_top_offset = $hearder_top.outerHeight(true); 936 } else { 937 hearder_top_offset = 0; 938 } 939 940 //for vertical nav, offset 0 941 if ($body.hasClass("vertical-nav")) { 942 hearder_top_offset = 0; 943 } 944 945 var top = $($anchor.attr('href')).offset().top - hearder_top_offset; 946 $('html, body').stop().animate({ 947 scrollTop: top 948 }, 1500, 'easeInOutExpo'); 949 950 }); 951 }, 952 953 /* ---------------------------------------------------------------------- */ 954 /* -------------------------- Scroll navigation ------------------------- */ 955 /* ---------------------------------------------------------------------- */ 956 TM_navLocalScorll: function () { 957 var data_offset = -60; 958 var $local_scroll = $("#menuzord .menuzord-menu, #menuzord-right .menuzord-menu"); 959 if ($local_scroll.length > 0) { 960 $local_scroll.localScroll({ 961 target: "body",
962 duration: 800, 963 offset: data_offset, 964 easing: "easeInOutExpo" 965 }); 966 } 967 968 var $local_scroll_other = $("#menuzord-side-panel .menuzord-menu, #menuzord-verticalnav .menuzord-menu, #fullpage-nav"); 969 if ($local_scroll_other.length > 0) { 970 $local_scroll_other.localScroll({ 971 target: "body", 972 duration: 800, 973 offset: 0, 974 easing: "easeInOutExpo" 975 }); 976 } 977 }, 978 979 /* ---------------------------------------------------------------------------- */ 980 /* --------------------------- collapsed menu close on click ------------------ */ 981 /* ---------------------------------------------------------------------------- */ 982 TM_scrollToFixed: function () { 983 $('.navbar-scrolltofixed').scrollToFixed(); 984 $('.scrolltofixed').scrollToFixed({ 985 marginTop: $('.header .header-nav').outerHeight(true) + 10, 986 limit: function () { 987 var limit = $('#footer').offset().top - $(this).outerHeight(true); 988 return limit; 989 } 990 }); 991 $('#sidebar').scrollToFixed({ 992 marginTop: $('.header .header-nav').outerHeight() + 20, 993 limit: function () { 994 var limit = $('#footer').offset().top - $('#sidebar').outerHeight() - 20; 995 return limit; 996 } 997 }); 998 }, 999 1000 /* ----------------------------------------------------------------------------- */ 1001 /* --------------------------- Menuzord - Responsive Megamenu ------------------ */ 1002 /* ----------------------------------------------------------------------------- */ 1003 TM_menuzord: function () { 1004 1005 var $menuzord = $("#menuzord"); 1006 if ($menuzord.length > 0) { 1007 $menuzord.menuzord({ 1008 align: "left", 1009 effect: "slide", 1010 animation: "none", 1011 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 1012 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1013 }); 1014 } 1015 1016 var $menuzord_right = $("#menuzord-right"); 1017 if ($menuzord_right.length > 0) { 1018 $menuzord_right.menuzord({ 1019 align: "right", 1020 effect: "slide", 1021 animation: "none", 1022 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 1023 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1024 }); 1025 } 1026 1027 var $menuzord_side_panel = $("#menuzord-side-panel"); 1028 if ($menuzord_side_panel.length > 0) { 1029 $menuzord_side_panel.menuzord({ 1030 align: "right", 1031 effect: "slide", 1032 animation: "none", 1033 indicatorFirstLevel: "", 1034 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1035 }); 1036 } 1037 1038 var $menuzord_vertical_nav = $("#menuzord-verticalnav"); 1039 if ($menuzord_vertical_nav.length > 0) { 1040 $menuzord_vertical_nav.menuzord({ 1041 align: "right", 1042 effect: "slide", 1043 animation: "none", 1044 indicatorFirstLevel: "<i class='fa fa-angle-down'></i>", 1045 indicatorSecondLevel: "<i class='fa fa-angle-right'></i>" 1046 }); 1047 } 1048 1049 }, 1050 1051 1052 1053 1054 /* ---------------------------------------------------------------------- */ 1055 /* --------------------------- Waypoint Top Nav Sticky ------------------ */ 1056 /* ---------------------------------------------------------------------- */ 1057 TM_topnavAnimate: function () { 1058 if ($window.scrollTop() > (50)) { 1059 // $(".navbar-sticky-animated").removeClass("animated-active"); 1060 } else { 1061 // $(".navbar-sticky-animated").addClass("animated-active"); 1062 } 1063 1064 if ($window.scrollTop() > (50)) { 1065 // $(".navbar-sticky-animated .header-nav-wrapper .container, .navbar-sticky-animated .header-nav-wrapper .container-fluid").removeClass("add-padding"); 1066 // $(".header-nav-wrapper").removeClass("floatnav"); 1067 } else { 1068 // $(".navbar-sticky-animated .header-nav-wrapper .container, .navbar-sticky-animated .header-nav-wrapper .container-fluid").addClass("add-padding"); 1069 // $(".header-nav-wrapper").addClass("floatnav"); 1070 } 1071 }, 1072 1073 /* ---------------------------------------------------------------------- */ 1074 /* ---------------- home section on scroll parallax & fade -------------- */ 1075 /* ---------------------------------------------------------------------- */ 1076 TM_homeParallaxFadeEffect: function () { 1077 if ($window.width() >= 1200) { 1078 var scrolled = $window.scrollTop(); 1079 $('.content-fade-effect .home-content .home-text').css('padding-top', (scrolled * 0.0610) + '%').css('opacity', 1 - (scrolled * 0.00120)); 1080 } 1081 }, 1082 1083 /* ---------------------------------------------------------------------- */ 1084 /* --------------------------- Top search toggle ----------------------- */ 1085 /* ---------------------------------------------------------------------- */ 1086 TM_topsearch_toggle: function () { 1087 $document_body.on('click', '#top-search-toggle', function (e) { 1088 e.preventDefault(); 1089 $('.search-form-wrapper.toggle').toggleClass('active'); 1090 return false; 1091 }); 1092 } 1093 1094 }; 1095 1096 THEMEMASCOT.widget = { 1097 1098 init: function () { 1099 1100 var t = setTimeout(function () { 1101 THEMEMASCOT.widget.TM_shopClickEvents(); 1102 THEMEMASCOT.widget.TM_fcCalender(); 1103 THEMEMASCOT.widget.TM_verticalTimeline(); 1104 THEMEMASCOT.widget.TM_verticalMasonryTimeline(); 1105 THEMEMASCOT.widget.TM_masonryIsotop(); 1106 THEMEMASCOT.widget.TM_pieChart(); 1107 THEMEMASCOT.widget.TM_progressBar(); 1108 THEMEMASCOT.widget.TM_funfact(); 1109 THEMEMASCOT.widget.TM_instagramFeed(); 1110 THEMEMASCOT.widget.TM_jflickrfeed(); 1111 THEMEMASCOT.widget.TM_accordion_toggles();
1112 THEMEMASCOT.widget.TM_tooltip(); 1113 //THEMEMASCOT.widget.TM_countDownTimer(); 1114 }, 0); 1115 1116 }, 1117 1118 /* ---------------------------------------------------------------------- */ 1119 /* ------------------------------ Shop Plus Minus ----------------------- */ 1120 /* ---------------------------------------------------------------------- */ 1121 TM_shopClickEvents: function () { 1122 $document_body.on('click', '.quantity .plus', function (e) { 1123 var currentVal = parseInt($(this).parent().children(".qty").val(), 10); 1124 if (!isNaN(currentVal)) { 1125 $(this).parent().children(".qty").val(currentVal + 1); 1126 } 1127 return false; 1128 }); 1129 1130 $document_body.on('click', '.quantity .minus', function (e) { 1131 var currentVal = parseInt($(this).parent().children(".qty").val(), 10); 1132 if (!isNaN(currentVal) && currentVal > 0) { 1133 $(this).parent().children(".qty").val(currentVal - 1); 1134 } 1135 return false; 1136 }); 1137 1138 $document_body.on('click', '#checkbox-ship-to-different-address', function (e) { 1139 $("#checkout-shipping-address").toggle(this.checked); 1140 }); 1141 }, 1142 1143 1144 /* ---------------------------------------------------------------------- */ 1145 /* ------------------------------ Event Calendar ------------------------ */ 1146 /* ---------------------------------------------------------------------- */ 1147 TM_fcCalender: function () { 1148 if (typeof calendarEvents !== "undefined") { 1149 var $full_event_calendar = $('#full-event-calendar'); 1150 if ($full_event_calendar.length > 0) { 1151 $full_event_calendar.fullCalendar({ 1152 header: { 1153 left: 'prev,next today', 1154 center: 'title', 1155 right: 'month,agendaWeek,agendaDay' 1156 }, 1157 defaultDate: '2018-01-12', 1158 selectable: true, 1159 selectHelper: true, 1160 select: function (start, end) { 1161 var title = prompt('Event Title:'); 1162 var eventData; 1163 if (title) { 1164 eventData = { 1165 title: title, 1166 start: start, 1167 end: end 1168 }; 1169 $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true 1170 } 1171 $('#calendar').fullCalendar('unselect'); 1172 }, 1173 editable: true, 1174 eventLimit: true, // allow "more" link when too many events 1175 events: calendarEvents 1176 }); 1177 } 1178 } 1179 }, 1180 1181 /* ---------------------------------------------------------------------- */ 1182 /* ------------------------------ Timeline Block ------------------------ */ 1183 /* ---------------------------------------------------------------------- */ 1184 TM_verticalTimeline: function () { 1185 var timelineBlocks = $('.cd-timeline-block'), 1186 offset = 0.8; 1187 1188 if (timelineBlocks.length > 0) { 1189 //hide timeline blocks which are outside the viewport 1190 hideBlocks(timelineBlocks, offset); 1191 //on scolling, show/animate timeline blocks when enter the viewport 1192 $window.on('scroll', function () { 1193 (!window.requestAnimationFrame) ? setTimeout(function () { 1194 showBlocks(timelineBlocks, offset); 1195 }, 100): window.requestAnimationFrame(function () { 1196 showBlocks(timelineBlocks, offset); 1197 }); 1198 }); 1199 } 1200 1201 function hideBlocks(blocks, offset) { 1202 blocks.each(function () { 1203 ($(this).offset().top > $window.scrollTop() + $window.height() * offset) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden'); 1204 }); 1205 } 1206 1207 function showBlocks(blocks, offset) { 1208 blocks.each(function () { 1209 ($(this).offset().top <= $window.scrollTop() + $window.height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden')) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in'); 1210 }); 1211 } 1212 }, 1213 1214 /* ---------------------------------------------------------------------- */ 1215 /* ----------------------- Vertical Masonry Timeline -------------------- */ 1216 /* ---------------------------------------------------------------------- */ 1217 TM_verticalMasonryTimeline: function () { 1218 var $masonry_timeline = $('.vertical-masonry-timeline'); 1219 if ($masonry_timeline.length > 0) { 1220 $masonry_timeline.isotope({ 1221 itemSelector: '.each-masonry-item', 1222 sortBy: 'original-order', 1223 layoutMode: 'masonry', 1224 resizable: false 1225 }); 1226 } 1227 1228 //=====> Timeline Positions 1229 function timeline_on_left_and_right() { 1230 $masonry_timeline.children('.each-masonry-item').each(function (index, element) { 1231 var last_child = $(this); 1232 var prev_last = $(this).prev(); 1233 var last_child_offset = parseInt(last_child.css('top'), 10); 1234 var prev_last_offset = parseInt(prev_last.css('top'), 10); 1235 var offset_icon = last_child_offset - prev_last_offset; 1236 1237 var go_top_to = 0; 1238 if (offset_icon) { 1239 if (offset_icon <= 87) { 1240 go_top_to = 87 - offset_icon; 1241 last_child.find('.timeline-post-format').animate({ 1242 top: go_top_to 1243 }, 300); 1244 } 1245 } 1246 1247 if ($(this).position().left === 0) { 1248 $(this).removeClass('item-right'); 1249 $(this).addClass('item-left'); 1250 } else { 1251 $(this).removeClass('item-left'); 1252 $(this).addClass('item-right'); 1253 } 1254 }); 1255 } 1256 1257 if ($masonry_timeline.length > 0) { 1258 timeline_on_left_and_right(); 1259 1260 $window.resize(function () { 1261 timeline_on_left_and_right(); 1262 }); 1263 } 1264 }, 1265 1266 /* ---------------------------------------------------------------------- */ 1267 /* ----------------------------- Masonry Isotope ------------------------ */ 1268 /* ---------------------------------------------------------------------- */ 1269 TM_masonryIsotop: function () { 1270 var isotope_mode; 1271 if ($portfolio_gallery.hasClass("masonry")) { 1272 isotope_mode = "masonry"; 1273 } else { 1274 isotope_mode = "fitRows"; 1275 } 1276 1277 //isotope firsttime loading 1278 if ($portfolio_gallery.length > 0) { 1279 $portfolio_gallery.imagesLoaded(function () { 1280 $portfolio_gallery.isotope({ 1281 itemSelector: '.gallery-item', 1282 layoutMode: isotope_mode, 1283 filter: "*" 1284 }); 1285 }); 1286 } 1287 1288 //isotope filter 1289 $document_body.on('click', portfolio_filter, function (e) { 1290 $(portfolio_filter).removeClass("active"); 1291 $(this).addClass("active"); 1292 var fselector = $(this).data('filter'); 1293 1294 $portfolio_gallery.isotope({ 1295 itemSelector: '.gallery-item', 1296 layoutMode: isotope_mode, 1297 filter: fselector 1298 }); 1299 return false; 1300 }); 1301 1302 THEMEMASCOT.slider.TM_flexslider(); 1303 1304 }, 1305 1306 TM_portfolioFlexSliderGalleryPopUpInit: function () { 1307 var $flexSliders = $portfolio_gallery.find('.slides'); 1308 if ($flexSliders.length > 0) { 1309 $flexSliders.each(function () { 1310 var _items = $(this).find("li > a"); 1311 var items = []; 1312 for (var i = 0; i < _items.length; i++) { 1313 items.push({ 1314 src: $(_items[i]).attr("href"), 1315 title: $(_items[i]).attr("title") 1316 }); 1317 } 1318 $(this).parent().parent().parent().find(".icons-holder").magnificPopup({ 1319 items: items, 1320 type: 'image', 1321 gallery: { 1322 enabled: true 1323 } 1324 }); 1325 }); 1326 } 1327 }, 1328 1329 TM_isotopeGridRearrange: function () { 1330 var isotope_mode; 1331 if ($portfolio_gallery.hasClass("masonry")) { 1332 isotope_mode = "masonry"; 1333 } else { 1334 isotope_mode = "fitRows"; 1335 } 1336 $portfolio_gallery.isotope({ 1337 itemSelector: '.gallery-item', 1338 layoutMode: isotope_mode 1339 }); 1340 }, 1341 1342 TM_isotopeGridShuffle: function () { 1343 $portfolio_gallery.isotope('shuffle'); 1344 }, 1345 1346 /* ---------------------------------------------------------------------- */ 1347 /* ----------------------------- CountDown ------------------------------ */ 1348 /* ---------------------------------------------------------------------- */ 1349 TM_countDownTimer: function () { 1350 var $clock = $('#clock-count-down'); 1351 var endingdate = $clock.data("endingdate"); 1352 if ($clock.length > 0) { 1353 $clock.countdown(endingdate, function (event) { 1354 var countdown_text = '' + 1355 '<ul class="countdown-timer">' + 1356 '<li>%D <span>Days</span></li>' + 1357 '<li>%H <span>Hours</span></li>' + 1358 '<li>%M <span>Minutes</span></li>' + 1359 '<li>%S <span>Seconds</span></li>' + 1360 '</ul>'; 1361 $(this).html(event.strftime(countdown_text)); 1362 }); 1363 } 1364 }, 1365 1366 1367 /* ---------------------------------------------------------------------- */ 1368 /* ----------------------- pie chart / circle skill bar ----------------- */ 1369 /* ---------------------------------------------------------------------- */ 1370 TM_pieChart: function () { 1371 var $piechart = $('.piechart'); 1372 if ($piechart.length > 0) {
1373 $piechart.appear(); 1374 $document_body.on('appear', '.piechart', function () { 1375 var current_item = $(this); 1376 if (!current_item.hasClass('appeared')) { 1377 var barcolor = current_item.data('barcolor'); 1378 var trackcolor = current_item.data('trackcolor'); 1379 var linewidth = current_item.data('linewidth'); 1380 var boxwidth = current_item.data('boxwidth'); 1381 current_item.css("width", boxwidth); 1382 current_item.easyPieChart({ 1383 animate: 3000, 1384 barColor: barcolor, 1385 trackColor: trackcolor, 1386 easing: 'easeOutBounce', 1387 lineWidth: linewidth, 1388 size: boxwidth, 1389 lineCap: 'square', 1390 scaleColor: false, 1391 onStep: function (from, to, percent) { 1392 $(this.el).find('span').text(Math.round(percent)); 1393 } 1394 }); 1395 current_item.addClass('appeared'); 1396 } 1397 }); 1398 } 1399 }, 1400 1401 /* ---------------------------------------------------------------------- */ 1402 /* ------------------- progress bar / horizontal skill bar -------------- */ 1403 /* ---------------------------------------------------------------------- */ 1404 TM_progressBar: function () { 1405 var $progress_bar = $('.progress-bar'); 1406 if ($progress_bar.length > 0) { 1407 $progress_bar.appear(); 1408 $document_body.on('appear', '.progress-bar', function () { 1409 var current_item = $(this); 1410 if (!current_item.hasClass('appeared')) { 1411 var percent = current_item.data('percent'); 1412 var barcolor = current_item.data('barcolor'); 1413 current_item.append('<span class="percent">' + percent + '%' + '</span>').css('background-color', barcolor).css('width', percent + '%').addClass('appeared'); 1414 } 1415 1416 }); 1417 } 1418 }, 1419 1420 /* ---------------------------------------------------------------------- */ 1421 /* ------------------------ Funfact Number Counter ---------------------- */ 1422 /* ---------------------------------------------------------------------- */ 1423 TM_funfact: function () { 1424 var $animate_number = $('.animate-number'); 1425 if ($animate_number.length > 0) { 1426 $animate_number.appear(); 1427 $document_body.on('appear', '.animate-number', function () { 1428 $animate_number.each(function () { 1429 var current_item = $(this); 1430 if (!current_item.hasClass('appeared')) { 1431 current_item.animateNumbers(current_item.attr("data-value"), true, parseInt(current_item.attr("data-animation-duration"), 10)).addClass('appeared'); 1432 } 1433 }); 1434 }); 1435 } 1436 }, 1437 1438 /* ---------------------------------------------------------------------- */ 1439 /* ----------------------------- Instagram Feed ---------------------------- */ 1440 /* ---------------------------------------------------------------------- */ 1441 TM_instagramFeed: function () { 1442 var $instagram_feed = $('.instagram-feed'); 1443 if ($instagram_feed.length > 0) { 1444 $instagram_feed.each(function () { 1445 var current_div = $(this); 1446 var instagramFeed = new Instafeed({ 1447 target: current_div.attr('id'), 1448 get: 'user', 1449 userId: current_div.data('userid'), 1450 accessToken: current_div.data('accesstoken'), 1451 resolution: current_div.data('resolution'), 1452 limit: current_div.data('limit'), 1453 template: '<div class="item"><figure><img src="{{image}}" /><a href="{{link}}" class="link-out" target="_blank"><i class="fa fa-link"></i></a></figure></div>', 1454 after: function () {} 1455 }); 1456 instagramFeed.run(); 1457 }); 1458 } 1459 1460 var $instagram_feed_carousel = $('.instagram-feed-carousel'); 1461 if ($instagram_feed_carousel.length > 0) { 1462 $instagram_feed_carousel.each(function () { 1463 var current_div = $(this); 1464 var instagramFeed = new Instafeed({ 1465 target: current_div.attr('id'), 1466 get: 'user', 1467 userId: current_div.data('userid'), 1468 accessToken: current_div.data('accesstoken'), 1469 resolution: current_div.data('resolution'), 1470 limit: current_div.data('limit'), 1471 template: '<div class="item"><figure><img src="{{image}}" /><a href="{{link}}" class="link-out" target="_blank"><i class="fa fa-link"></i></a></figure></div>', 1472 after: function () { 1473 current_div.owlCarousel({ 1474 rtl: THEMEMASCOT.isRTL.check(), 1475 autoplay: true, 1476 autoplayTimeout: 4000, 1477 loop: true, 1478 margin: 15, 1479 dots: true, 1480 nav: false, 1481 responsive: { 1482 0: { 1483 items: 2 1484 }, 1485 768: { 1486 items: 4 1487 }, 1488 1000: { 1489 items: 5 1490 } 1491 } 1492 }); 1493 } 1494 }); 1495 instagramFeed.run(); 1496 }); 1497 } 1498 }, 1499 1500 /* ---------------------------------------------------------------------- */ 1501 /* ---------------------------- Flickr Feed ----------------------------- */ 1502 /* ---------------------------------------------------------------------- */ 1503 TM_jflickrfeed: function () { 1504 var $jflickrfeed = $(".flickr-widget .flickr-feed, .jflickrfeed"); 1505 if ($jflickrfeed.length > 0) { 1506 $jflickrfeed.each(function () { 1507 var current_div = $(this); 1508 current_div.jflickrfeed({ 1509 limit: 9, 1510 qstrings: { 1511 id: current_div.data('userid') 1512 }, 1513 itemTemplate: '<a href="{{link}}" title="{{title}}" target="_blank"><img src="{{image_m}}" alt="{{title}}"> </a>' 1514 }); 1515 }); 1516 } 1517 }, 1518 1519 /* ---------------------------------------------------------------------- */ 1520 /* ------------------------- accordion & toggles ------------------------ */ 1521 /* ---------------------------------------------------------------------- */ 1522 TM_accordion_toggles: function () { 1523 var $panel_group_collapse = $('.panel-group .collapse'); 1524 $panel_group_collapse.on("show.bs.collapse", function (e) { 1525 $(this).closest(".panel-group").find("[href='#" + $(this).attr("id") + "']").addClass("active"); 1526 }); 1527 $panel_group_collapse.on("hide.bs.collapse", function (e) { 1528 $(this).closest(".panel-group").find("[href='#" + $(this).attr("id") + "']").removeClass("active"); 1529 }); 1530 }, 1531 1532 /* ---------------------------------------------------------------------- */ 1533 /* ------------------------------- tooltip ----------------------------- */ 1534 /* ---------------------------------------------------------------------- */ 1535 TM_tooltip: function () { 1536 var $tooltip = $('[data-toggle="tooltip"]'); 1537 if ($tooltip.length > 0) { 1538 $tooltip.tooltip(); 1539 } 1540 }, 1541 1542 /* ---------------------------------------------------------------------- */ 1543 /* ---------------------------- Twitter Feed --------------------------- */ 1544 /* ---------------------------------------------------------------------- */ 1545 TM_twittie: function () { 1546 var $twitter_feed = $('.twitter-feed'); 1547 var $twitter_feed_carousel = $('.twitter-feed-carousel'); 1548 1549 if ($twitter_feed.length > 0) { 1550 $twitter_feed.twittie({ 1551 username: $twitter_feed.data('username'), 1552 dateFormat: '%b. %d, %Y', 1553 template: '{{tweet}} <div class="date">{{date}}</div>',
1554 count: ($twitter_feed.data("count") === undefined) ? 4 : $twitter_feed.data("count"), 1555 loadingText: 'Loading!' 1556 }); 1557 } 1558 1559 if ($twitter_feed_carousel.length > 0) { 1560 $twitter_feed_carousel.twittie({ 1561 username: $twitter_feed_carousel.data('username'), 1562 dateFormat: '%b. %d, %Y', 1563 template: '{{tweet}} <div class="date">{{date}}</div>', 1564 count: ($twitter_feed_carousel.data("count") === undefined) ? 4 : $twitter_feed_carousel.data("count"), 1565 loadingText: 'Loading!' 1566 }, function () { 1567 $twitter_feed_carousel.find('ul').owlCarousel({ 1568 rtl: THEMEMASCOT.isRTL.check(), 1569 autoplay: true, 1570 autoplayTimeout: 2000, 1571 loop: true, 1572 items: 1, 1573 dots: true, 1574 nav: false 1575 }); 1576 }); 1577 } 1578 } 1579 }; 1580 1581 THEMEMASCOT.slider = { 1582 1583 init: function () { 1584 1585 var t = setTimeout(function () { 1586 THEMEMASCOT.slider.TM_typedAnimation(); 1587 THEMEMASCOT.slider.TM_flexslider(); 1588 THEMEMASCOT.slider.TM_owlCarousel(); 1589 THEMEMASCOT.slider.TM_maximageSlider(); 1590 THEMEMASCOT.slider.TM_bxslider(); 1591 }, 0); 1592 1593 }, 1594 1595 1596 /* ---------------------------------------------------------------------- */ 1597 /* -------------------------- Typed Text Carousel ---------------------- */ 1598 /* ---------------------------------------------------------------------- */ 1599 TM_typedAnimation: function () { 1600 var $typed_text_carousel = $('.typed-text-carousel'); 1601 if ($typed_text_carousel.length > 0) { 1602 $typed_text_carousel.each(function () { 1603 var string_1 = $(this).find('span:first-child').text(); 1604 var string_2 = $(this).find('span:nth-child(2)').text(); 1605 var string_3 = $(this).find('span:nth-child(3)').text(); 1606 var str = ''; 1607 var $this = $(this); 1608 if (!string_2.trim() || !string_3.trim()) { 1609 str = [string_1]; 1610 } 1611 if (!string_3.trim() && string_2.length) { 1612 str = [string_1, string_2]; 1613 } 1614 if (string_1.length && string_2.length && string_3.length) { 1615 str = [string_1, string_2, string_3]; 1616 } 1617 var speed = $(this).data('speed'); 1618 var back_delay = $(this).data('back_delay'); 1619 var loop = $(this).data('loop'); 1620 $(this).typed({ 1621 strings: str, 1622 typeSpeed: speed, 1623 backSpeed: 0, 1624 backDelay: back_delay, 1625 cursorChar: "|", 1626 loop: loop, 1627 contentType: 'text', 1628 loopCount: false 1629 }); 1630 }); 1631 } 1632 }, 1633 1634 1635 /* ---------------------------------------------------------------------- */ 1636 /* -------------------------------- flexslider ------------------------- */ 1637 /* ---------------------------------------------------------------------- */ 1638 TM_flexslider: function () { 1639 var $each_flex_slider = $('.flexslider-wrapper').find('.flexslider'); 1640 if ($each_flex_slider.length > 0) { 1641 THEMEMASCOT.widget.TM_portfolioFlexSliderGalleryPopUpInit(); 1642 $each_flex_slider.each(function () { 1643 var $flex_slider = $(this); 1644 var data_direction = ($flex_slider.parent().data("direction") === undefined) ? 'horizontal' : $flex_slider.parent().data("direction"); 1645 var data_controlNav = ($flex_slider.parent().data("c
1645ontrolnav") === undefined) ? true : $flex_slider.parent().data("controlnav"); 1646 var data_directionnav = ($flex_slider.parent().data("directionnav") === undefined) ? true : $flex_slider.parent().data("directionnav"); 1647 $flex_slider.flexslider({ 1648 rtl: THEMEMASCOT.isRTL.check(), 1649 selector: ".slides > li", 1650 animation: "slide", 1651 easing: "swing", 1652 direction: data_direction, 1653 slideshow: true, 1654 slideshowSpeed: 7000, 1655 animationSpeed: 600, 1656 pauseOnHover: false, 1657 controlNav: data_controlNav, 1658 directionNav: data_directionnav, 1659 start: function (slider) { 1660 imagesLoaded($portfolio_gallery, function () { 1661 setTimeout(function () { 1662 $portfolio_filter_first_child.trigger("click"); 1663 }, 500); 1664 }); 1665 THEMEMASCOT.initialize.TM_magnificPopup_lightbox(); 1666 THEMEMASCOT.initialize.TM_prettyPhoto_lightbox(); 1667 THEMEMASCOT.initialize.TM_nivolightbox(); 1668 }, 1669 after: function () {} 1670 }); 1671 }); 1672 } 1673 }, 1674 1675 /* ---------------------------------------------------------------------- */ 1676 /* -------------------------------- Owl Carousel ----------------------- */ 1677 /* ---------------------------------------------------------------------- */ 1678 TM_owlCarousel: function () { 1679 var $owl_carousel_1col = $('.owl-carousel-1col, .text-carousel, .image-carousel, .fullwidth-carousel'); 1680 if ($owl_carousel_1col.length > 0) { 1681 $owl_carousel_1col.each(function () { 1682 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1683 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1684 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1685 $(this).owlCarousel({ 1686 rtl: THEMEMASCOT.isRTL.check(), 1687 autoplay: true, 1688 autoplayTimeout: data_duration, 1689 loop: true, 1690 items: 1, 1691 dots: true, 1692 // dots: data_dots, 1693 nav: data_nav, 1694 navText: [ 1695 '<i class="pe-7s-angle-left"></i>', 1696 '<i class="pe-7s-angle-right"></i>' 1697 ] 1698 }); 1699 }); 1700 } 1701 1702 /* -------------------------------- slider finish run ----------------------- */ 1703 detechyg(); 1704 1705 $(window).on('load resize', function () { 1706 detechyg(); 1707 1708 }) 1709 1710 1711 function detechyg() { 1712 if ($('.ygcontent').length >= 1) { 1713 var getygc = $('.ygcontent').outerHeight(); 1714 var winw = $(window).width(); 1715 1716 if (winw >= 990) { 1717 if (getygc <= $('.ygsidebar').outerHeight()) { 1718 $('.ygsidebar').css('height', 'auto'); 1719 } else { 1720 $('.ygsidebar').css('height', getygc); 1721 } 1722 1723 } else { 1724 $('.ygsidebar').css('height', 'auto'); 1725 } 1726 1727 } 1728 1729 } 1730 1731 var $owl_carousel_2col = $('.owl-carousel-2col'); 1732 if ($owl_carousel_2col.length > 0) { 1733 $owl_carousel_2col.each(function () { 1734 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1735 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1736 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1737 $(this).owlCarousel({ 1738 rtl: THEMEMASCOT.isRTL.check(), 1739 autoplay: true, 1740 autoplayTimeout: data_duration, 1741 loop: true, 1742 items: 2, 1743 margin: 15, 1744 dots: data_dots, 1745 nav: data_nav, 1746 navText: [ 1747 '<i class="pe-7s-angle-left"></i>', 1748 '<i class="pe-7s-angle-right"></i>' 1749 ], 1750 responsive: { 1751 0: { 1752 items: 1, 1753 center: false 1754 }, 1755 480: { 1756 items: 1, 1757 center: false 1758 }, 1759 600: { 1760 items: 1, 1761 center: false 1762 }, 1763 750: { 1764 items: 2, 1765 center: false 1766 }, 1767 960: { 1768 items: 2 1769 }, 1770 1170: { 1771 items: 2 1772 }, 1773 1300: { 1774 items: 2 1775 } 1776 } 1777 }); 1778 }); 1779 } 1780 1781 var $owl_carousel_3col = $('.owl-carousel-3col'); 1782 if ($owl_carousel_3col.length > 0) { 1783 $owl_carousel_3col.each(function () { 1784 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1785 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1786 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1787 $(this).owlCarousel({ 1788 rtl: THEMEMASCOT.isRTL.check(), 1789 autoplay: true, 1790 autoplayTimeout: data_duration, 1791 loop: true, 1792 items: 3, 1793 margin: 15, 1794 dots: data_dots, 1795 nav: data_nav, 1796 navText: [ 1797 '<i class="pe-7s-angle-left"></i>', 1798 '<i class="pe-7s-angle-right"></i>' 1799 ], 1800 responsive: { 1801 0: { 1802 items: 1, 1803 center: false 1804 }, 1805 480: { 1806 items: 1, 1807 center: false 1808 }, 1809 600: { 1810 items: 1, 1811 center: false 1812 }, 1813 750: { 1814 items: 2, 1815 center: false 1816 }, 1817 960: { 1818 items: 2 1819 }, 1820 1170: { 1821 items: 3 1822 }, 1823 1300: { 1824 items: 3 1825 } 1826 } 1827 }); 1828 }); 1829 } 1830 1831 1832 var $owl_carousel_4col = $('.owl-carousel-4col'); 1833 if ($owl_carousel_4col.length > 0) { 1834 $owl_carousel_4col.each(function () { 1835 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1836 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1837 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1838 $(this).owlCarousel({ 1839 rtl: THEMEMASCOT.isRTL.check(), 1840 autoplay: true, 1841 autoplayTimeout: data_duration, 1842 loop: true, 1843 items: 4, 1844 margin: 15, 1845 dots: data_dots, 1846 nav: data_nav, 1847 navText: [ 1848 '<i class="pe-7s-angle-left"></i>', 1849 '<i class="pe-7s-angle-right"></i>' 1850 ], 1851 responsive: { 1852 0: { 1853 items: 1, 1854 center: true 1855 }, 1856 480: { 1857 items: 1, 1858 center: false 1859 }, 1860 600: { 1861 items: 3, 1862 center: false 1863 }, 1864 750: { 1865 items: 3, 1866 center: false 1867 }, 1868 960: { 1869 items: 3 1870 }, 1871 1170: { 1872 items: 4 1873 }, 1874 1300: { 1875 items: 4 1876 } 1877 } 1878 }); 1879 }); 1880 } 1881 1882 var $owl_carousel_5col = $('.owl-carousel-5col'); 1883 if ($owl_carousel_5col.length > 0) { 1884 $owl_carousel_5col.each(function () { 1885 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1886 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1887 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1888 $(this).owlCarousel({ 1889 rtl: THEMEMASCOT.isRTL.check(), 1890 autoplay: true, 1891 autoplayTimeout: data_duration, 1892 loop: true, 1893 items: 5, 1894 margin: 15, 1895 dots: data_dots, 1896 nav: data_nav, 1897 navText: [ 1898 '<i class="pe-7s-angle-left"></i>', 1899 '<i class="pe-7s-angle-right"></i>' 1900 ], 1901 responsive: { 1902 0: { 1903 items: 1, 1904 center: false 1905 }, 1906 480: { 1907 items: 1, 1908 center: false 1909 }, 1910 600: { 1911 items: 2, 1912 center: false 1913 }, 1914 750: { 1915 items: 3, 1916 center: false 1917 }, 1918 960: { 1919 items: 4 1920 }, 1921 1170: { 1922 items: 5 1923 }, 1924 1300: { 1925 items: 5 1926 } 1927 } 1928 }); 1929 }); 1930 } 1931 1932 var $owl_carousel_6col = $('.owl-carousel-6col'); 1933 if ($owl_carousel_6col.length > 0) { 1934 $owl_carousel_6col.each(function () { 1935 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1936 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1937 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1938 $(this).owlCarousel({ 1939 rtl: THEMEMASCOT.isRTL.check(), 1940 autoplay: true, 1941 autoplayTimeout: data_duration, 1942 loop: true, 1943 items: 6, 1944 margin: 15, 1945 dots: data_dots, 1946 nav: data_nav, 1947 navText: [ 1948 '<i class="pe-7s-angle-left"></i>', 1949 '<i class="pe-7s-angle-right"></i>' 1950 ], 1951 responsive: { 1952 0: { 1953 items: 1, 1954 center: false 1955 }, 1956 480: { 1957 items: 1, 1958 center: false 1959 }, 1960 600: { 1961 items: 2, 1962 center: false 1963 }, 1964 750: { 1965 items: 3, 1966 center: false 1967 }, 1968 960: { 1969 items: 4 1970 }, 1971 1170: { 1972 items: 6 1973 }, 1974 1300: { 1975 items: 6 1976 } 1977 } 1978 }); 1979 }); 1980 } 1981 1982 var $owl_carousel_7col = $('.owl-carousel-7col'); 1983 if ($owl_carousel_7col.length > 0) { 1984 $owl_carousel_7col.each(function () { 1985 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 1986 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 1987 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 1988 $(this).owlCarousel({ 1989 rtl: THEMEMASCOT.isRTL.check(), 1990 autoplay: true, 1991 autoplayTimeout: data_duration, 1992 loop: true, 1993 items: 7, 1994 margin: 15, 1995 dots: data_dots, 1996 nav: data_nav, 1997 navText: [ 1998 '<i class="pe-7s-angle-left"></i>', 1999 '<i class="pe-7s-angle-right"></i>' 2000 ], 2001 responsive: { 2002 0: { 2003 items: 1, 2004 center: false 2005 }, 2006 600: { 2007 items: 2, 2008 center: false 2009 }, 2010 750: { 2011 items: 3, 2012 center: false 2013
2013 }, 2014 960: { 2015 items: 4 2016 }, 2017 1170: { 2018 items: 7 2019 }, 2020 1300: { 2021 items: 7 2022 } 2023 } 2024 }); 2025 }); 2026 } 2027 2028 var $owl_carousel_8col = $('.owl-carousel-8col'); 2029 if ($owl_carousel_8col.length > 0) { 2030 $owl_carousel_8col.each(function () { 2031 var data_dots = ($(this).data("dots") === undefined) ? false : $(this).data("dots"); 2032 var data_nav = ($(this).data("nav") === undefined) ? false : $(this).data("nav"); 2033 var data_duration = ($(this).data("duration") === undefined) ? 4000 : $(this).data("duration"); 2034 $(this).owlCarousel({ 2035 rtl: THEMEMASCOT.isRTL.check(), 2036 autoplay: true, 2037 autoplayTimeout: data_duration, 2038 loop: true, 2039 items: 8, 2040 margin: 15, 2041 dots: data_dots, 2042 nav: data_nav, 2043 navText: [ 2044 '<i class="pe-7s-angle-left"></i>', 2045 '<i class="pe-7s-angle-right"></i>' 2046 ], 2047 responsive: { 2048 0: { 2049 items: 1, 2050 center: false 2051 }, 2052 600: { 2053 items: 2, 2054 center: false 2055 }, 2056 750: { 2057 items: 3, 2058 center: false 2059 }, 2060 960: { 2061 items: 5 2062 }, 2063 1170: { 2064 items: 8 2065 }, 2066 1300: { 2067 items: 8 2068 } 2069 } 2070 }); 2071 }); 2072 } 2073 2074 }, 2075 2076 2077 2078 2079 /* ---------------------------------------------------------------------- */ 2080 /* ----------------------------- BxSlider ------------------------------ */ 2081 /* ---------------------------------------------------------------------- */ 2082 TM_bxslider: function () { 2083 var $bxslider = $('.bxslider'); 2084 if ($bxslider.length > 0) { 2085 $bxslider.bxSlider({ 2086 mode: 'vertical', 2087 minSlides: ($bxslider.data("count") === undefined) ? 2 : $bxslider.data("count"), 2088 slideMargin: 20, 2089 pager: false, 2090 prevText: '<i class="fa fa-angle-left"></i>', 2091 nextText: '<i class="fa fa-angle-right"></i>' 2092 }); 2093 } 2094 2095 var $thbreview = $('.thbreview'); 2096 if ($thbreview.length > 0) { 2097 $thbreview.bxSlider({ 2098 2099 maxSlides: 10, 2100 minSlides: 2, 2101 slideMargin: 10, 2102 slideWidth: 60, 2103 infiniteLoop: false, 2104 2105 prevText: '<i class="fa fa-angle-left"></i>', 2106 nextText: '<i class="fa fa-angle-right"></i>' 2107 }); 2108 } 2109 2110 $(window).on('load resize', function () { 2111 if ($('.thbreview-outer .bx-viewport').width() < $('.thbreview-outer').width() - 60) { 2112 $('.thbreview-outer .bx-wrapper').css('float', 'left'); 2113 } else { 2114 $('.thbreview-outer .bx-wrapper').css('float', 'auto'); 2115 } 2116 }); 2117 2118 2119 }, 2120 2121 2122 /* ---------------------------------------------------------------------- */
2123 /* ---------- maximage Fullscreen Parallax Background Slider ----------- */ 2124 /* ---------------------------------------------------------------------- */ 2125 TM_maximageSlider: function () { 2126 var $maximage_slider = $('#maximage'); 2127 if ($maximage_slider.length > 0) { 2128 $maximage_slider.maximage({ 2129 cycleOptions: { 2130 fx: 'fade', 2131 speed: 1500, 2132 prev: '.img-prev', 2133 next: '.img-next' 2134 } 2135 }); 2136 } 2137 } 2138 }; 2139 2140 2141 /* ---------------------------------------------------------------------- */ 2142 /* ---------- document ready, window load, scroll and resize ------------ */ 2143 /* ---------------------------------------------------------------------- */ 2144 //document ready 2145 THEMEMASCOT.documentOnReady = { 2146 init: function () { 2147 THEMEMASCOT.initialize.init(); 2148 THEMEMASCOT.header.init(); 2149 THEMEMASCOT.slider.init(); 2150 THEMEMASCOT.widget.init(); 2151 THEMEMASCOT.windowOnscroll.init(); 2152 } 2153 }; 2154 2155 //window on load 2156 THEMEMASCOT.windowOnLoad = { 2157 init: function () { 2158 var t = setTimeout(function () { 2159 THEMEMASCOT.initialize.TM_wow(); 2160 THEMEMASCOT.widget.TM_twittie(); 2161 THEMEMASCOT.initialize.TM_magnificPopup_lightbox(); 2162 THEMEMASCOT.initialize.TM_preLoaderOnLoad(); 2163 THEMEMASCOT.initialize.TM_hashForwarding(); 2164 THEMEMASCOT.initialize.TM_parallaxBgInit(); 2165 }, 0); 2166 $window.trigger("scroll"); 2167 $window.trigger("resize"); 2168 } 2169 }; 2170 2171 //window on scroll 2172 THEMEMASCOT.windowOnscroll = { 2173 init: function () { 2174 $window.on('scroll', function () { 2175 THEMEMASCOT.header.TM_scroolToTop(); 2176 THEMEMASCOT.header.TM_activateMenuItemOnReach(); 2177 THEMEMASCOT.header.TM_topnavAnimate(); 2178 }); 2179 } 2180 }; 2181 2182 //window on resize 2183 THEMEMASCOT.windowOnResize = { 2184 init: function () { 2185 var t = setTimeout(function () { 2186 THEMEMASCOT.initialize.TM_equalHeightDivs(); 2187 THEMEMASCOT.initialize.TM_resizeFullscreen(); 2188 }, 400); 2189 } 2190 }; 2191 2192 2193 /* ---------------------------------------------------------------------- */ 2194 /* ---------------------------- Call Functions -------------------------- */ 2195 /* ---------------------------------------------------------------------- */ 2196 $document.ready( 2197 THEMEMASCOT.documentOnReady.init 2198 ); 2199 $window.load( 2200 THEMEMASCOT.windowOnLoad.init 2201 ); 2202 $window.on('resize', 2203 THEMEMASCOT.windowOnResize.init 2204 ); 2205 2206 //call function before document ready 2207 THEMEMASCOT.initialize.TM_preLoaderClickDisable(); 2208 2209})(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.