1/*************************************************************************************************************** 2|||||||||||||||||||||||||||| CUSTOM SCRIPT FOR Fitness Care |||||||||||||||||||||||||||||||||||| 3**************************************************************************************************************** 4|||||||||||||||||||||||||||| TABLE OF CONTENT |||||||||||||||||||||||||||||||||||| 5**************************************************************************************************************** 6**************************************************************************************************************** 71. revolution slider 82. accrodion 93. gallery fancybox activator 104. select menu 115. client carousel 126. counter number changer 137. contact form validation 148. sticky header 159. gallery 1610. typed plugin 1711. testimonails carousel 1812. team carousel style two 1913. testimonails carousel 2014. Tool tip active 2115. Featured hover 2216. language swticher 2317. about carousel 2418. testimonial widget carousel 2519. single project carousel 2620. blog share slide 2721. responsive video 2822. price filter 2923. cart touch spin 3024. video fancybox 3125. contact form validation 3225. menu active 3325. header search 3426. health care pack carousel 3527. video gallery box 36setting up values on init 37mainImg.attr('src', mainImgSrc); 3828. schedule filter 3929. product carousel 4030. gallery masonary layout 4131. single product careousel 4232. scoll to target 4333. custom progress bar 4434. bmi calculator 4535. mailchimp active 4636. mobile navigation 4737. dynamic divider 48**************************************************************************************************************** 49|||||||||||||||||||||||||||| End TABLE OF CONTENT |||||||||||||||||||||||||||||||||||| 50****************************************************************************************************************/ 51 52 53 54"use strict"; // Start of use strict 55 56// 1. revolution slider 57function revolutionSliderActiver() { 58 if ($('.rev_slider_wrapper #slider1').length) { 59 jQuery("#slider1").revolution({ 60 sliderType: "standard", 61 sliderLayout: "auto", 62 delay: 5000, 63 navigation: { 64 arrows: { enable: true } 65 }, 66 gridwidth: 1170, 67 gridheight: 1000 68 }); 69 }; 70 if ($('.rev_slider_wrapper #slider2').length) { 71 var height = $("#slider2").data('height'); 72 var sDelay = $("#slider2").data('delay'); 73 if (!height) { 74 height = 825; 75 }; 76 if (!sDelay) { 77 sDelay = 5000; 78 }; 79 80 $("#slider2").revolution({ 81 sliderType: "standard", 82 sliderLayout: "auto", 83 delay: sDelay, 84 navigation: { 85 arrows: { enable: true } 86 }, 87 responsiveLevels:[2020,1183,975,751,484], 88 gridwidth:[1170,970,750,500,450], 89 // gridwidth: 1170, 90 gridheight: [height, 600, 400, 400, 400] 91 }); 92 }; 93} 94// 2. accrodion 95function accrodion() { 96 if ($('.accrodion-grp').length) { 97 98 $('.accrodion-grp').each(function() { 99 var accrodionName = $(this).data('grp-name'); 100 var Self = $(this); 101 Self.addClass(accrodionName); 102 Self.find('.accrodion .accrodion-content').hide(); 103 Self.find('.accrodion.active').find('.accrodion-content').show(); 104 Self.find('.accrodion').each(function() { 105 $(this).find('.accrodion-title').on('click', function() { 106 if ($(this).parent().hasClass('active') === false) { 107 $('.accrodion-grp.' + accrodionName).find('.accrodion').removeClass('active'); 108 $('.accrodion-grp.' + accrodionName).find('.accrodion').find('.accrodion-content').slideUp(); 109 $(this).parent().addClass('active'); 110 $(this).parent().find('.accrodion-content').slideDown(); 111 }; 112 }); 113 }); 114 }); 115 116 }; 117} 118// 3. gallery fancybox activator 119function GalleryFancyboxActivator() { 120 var galleryFcb = $('.fancybox'); 121 if (galleryFcb.length) { 122 galleryFcb.fancybox({ 123 openEffect: 'elastic', 124 closeEffect: 'elastic', 125 helpers: { 126 media: {} 127 } 128 }); 129 } 130} 131// 4. select menu 132function selectMenu() { 133 if ($('.select-menu').length) { 134 $('.select-menu').selectmenu(); 135 }; 136} 137// 5. client carousel 138function clientCarousel() {
139 if ($('.client-carousel').length) { 140 $('.client-carousel.owl-carousel').owlCarousel({ 141 loop: true, 142 margin: 30, 143 nav: false, 144 dots: false, 145 autoWidth: false, 146 autoplay: true, 147 autoplayTimeout: 3000, 148 autoplayHoverPause: true, 149 responsive: { 150 0: { 151 items: 1, 152 autoWidth: false 153 }, 154 480: { 155 items: 2, 156 autoWidth: false 157 }, 158 600: { 159 items: 3, 160 autoWidth: false 161 }, 162 1000: { 163 items: 4, 164 autoWidth: false 165 } 166 } 167 }); 168 }; 169} 170// 6. counter number changer 171function CounterNumberChanger() { 172 var timer = $('.timer'); 173 if (timer.length) { 174 timer.appear(function() { 175 timer.countTo(); 176 }) 177 } 178} 179// 7. contact form validation 180function contactFormValidation() { 181 182 if ($('.contact-form').length) { 183 $('.contact-form').validate({ // initialize the plugin 184 rules: { 185 name: { 186 required: true 187 }, 188 email: { 189 required: true, 190 email: true 191 }, 192 message: { 193 required: true 194 }, 195 subject: { 196 required: true 197 } 198 }, 199 submitHandler: function(form) { 200 // sending value with ajax request 201 $.post($(form).attr('action'), $(form).serialize(), function(response) { 202 $(form).parent('div').append(response); 203 $(form).find('input[type="text"]').val(''); 204 $(form).find('input[type="email"]').val(''); 205 $(form).find('textarea').val(''); 206 }); 207 return false; 208 } 209 }); 210 } 211} 212// 8. sticky header 213function stickyHeader() { 214 if ($('.stricky').length) { 215 var strickyScrollPos = 100; 216 if ($(window).scrollTop() > strickyScrollPos) { 217 // $('.stricky').removeClass('slideIn animated'); 218 // $('.stricky').addClass('stricky-fixed fadeInDown animated'); 219 $('.stricky').addClass('stricky-fixed'); 220 $('.scroll-to-top').fadeIn(500); 221 } else if ($(this).scrollTop() <= strickyScrollPos) { 222 // $('.stricky').removeClass('stricky-fixed fadeInDown animated'); 223 $('.stricky').removeClass('stricky-fixed'); 224 // $('.stricky').addClass('slideIn animated'); 225 $('.scroll-to-top').fadeOut(500); 226 } 227 }; 228} 229// 9. gallery 230function fleetGallery() { 231 if ($('.mixit-gallery').length) { 232 $('.mixit-gallery').mixItUp(); 233 }; 234} 235// 10. typed plugin 236function typed() { 237 if ($(".typed").length) { 238 $(".typed").typed({ 239 stringsElement: $('.typed-strings'), 240 typeSpeed: 200, 241 backDelay: 1500, 242 loop: true, 243 contentType: 'html', // or text 244 // defaults to false for infinite loop 245 loopCount: false, 246 callback: function() { null; }, 247 resetCallback: function() { newTyped(); } 248 }); 249 }; 250} 251 252 253 254// 11. testimonails carousel 255function testimonialsCarosuleGardener() { 256 if ($('.testimonial-carousel-wrapper').length) { 257 $('.testimonial-carousel-wrapper.owl-carousel').owlCarousel({ 258 loop: true, 259 margin: 0, 260 nav: false, 261 dots: true, 262 autoplay: true, 263 autoplayHoverPause: true, 264 responsive: { 265 0: { 266 items: 1 267 }, 268 480: { 269 items: 1 270 }, 271 600: { 272 items: 1 273 }, 274 1000: { 275 items: 1 276 } 277 } 278 }); 279 } 280 if ($('.testimonial-carousel-2-col').length) { 281 $('.testimonial-carousel-2-col.owl-carousel').owlCarousel({ 282 loop: true, 283 margin: 30, 284 nav: true, 285 navText: [ 286 '<i class="fa fa-angle-left"></i>', 287 '<i class="fa fa-angle-right"></i>' 288 ], 289 dots: false, 290 autoplay: true, 291 autoplayHoverPause: true, 292 responsive: { 293 0: { 294 items: 1 295 }, 296 480: { 297 items: 1 298 }, 299 980: { 300 items: 1 301 }, 302 1000: { 303 items: 2 304 } 305 } 306 }); 307 } 308} 309 310// 12. team carousel style two 311 312function teamCarouselStyleTwo() { 313 if ($('.fitness-team-style-two .owl-carousel').length) { 314 $('.fitness-team-style-two .owl-carousel').owlCarousel({ 315 loop: true, 316 margin: 180, 317 nav: true, 318 navText: [ 319 '<i class="fa fa-angle-left"></i>', 320 '<i class="fa fa-angle-right"></i>' 321 ], 322 dots: false, 323 autoplay: true, 324 autoplayHoverPause: true, 325 responsive: { 326 0: { 327 items: 1 328 }, 329 480: { 330 items: 1 331 }, 332 600: { 333 items: 1 334 }, 335 1000: { 336 items: 2 337 }, 338 1200: { 339 items: 3 340 } 341 } 342 }); 343 } 344} 345// 13. testimonails carousel 346function relatedProjectCarosule() {
347 if ($('.related-project-carousel-2col').length) { 348 $('.related-project-carousel-2col').owlCarousel({ 349 loop: true, 350 margin: 30, 351 nav: true, 352 dots: false, 353 autoplay: true, 354 autoplayHoverPause: true, 355 navText: [ 356 '<i class="fa fa-angle-left"></i>', 357 '<i class="fa fa-angle-right"></i>' 358 ], 359 responsive: { 360 0: { 361 items: 1 362 }, 363 480: { 364 items: 1 365 }, 366 600: { 367 items: 2 368 }, 369 1000: { 370 items: 2 371 } 372 } 373 }); 374 } 375 if ($('.related-project-carousel-3col').length) { 376 $('.related-project-carousel-3col').owlCarousel({ 377 loop: true, 378 margin: 30, 379 nav: true, 380 dots: false, 381 autoplay: true, 382 autoplayHoverPause: true, 383 navText: [ 384 '<i class="fa fa-angle-left"></i>', 385 '<i class="fa fa-angle-right"></i>' 386 ], 387 responsive: { 388 0: { 389 items: 1 390 }, 391 480: { 392 items: 1 393 }, 394 600: { 395 items: 2 396 }, 397 1000: { 398 items: 3 399 } 400 } 401 }); 402 } 403} 404// 14. Tool tip active 405function toolTip() { 406 $('[data-toggle="tooltip"]').tooltip(); 407} 408// 15. Featured hover 409function singleFeaturedHover() { 410 if ($('.single-our-feature').length) { 411 $('.single-our-feature').hover(function() { 412 var bgHover = $(this).data('hover-background'); 413 $(this).css({ 414 'background-image': 'url(' + bgHover + ')' 415 }); 416 }, function() { 417 $(this).css({ 418 'background-image': '' 419 }); 420 }); 421 }; 422} 423// 16. language swticher 424function languageSwitcher() { 425 if ($("#polyglot-language-options").length) { 426 $('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({ 427 effect: 'fade', 428 testMode: true, 429 onChange: function(evt) { 430 alert("The selected language is: " + evt.selectedItem); 431 } 432 }); 433 }; 434} 435// 17. about carousel 436function aboutCarousel() { 437 if ($('.about-page .owl-carousel').length) { 438 $('.about-page .owl-carousel').owlCarousel({ 439 loop: true, 440 margin: 0, 441 nav: false, 442 dots: true, 443 autoplay: true, 444 autoplayHoverPause: true, 445 responsive: { 446 0: { 447 items: 1 448 }, 449 480: { 450 items: 1 451 }, 452 600: { 453 items: 1 454 }, 455 1000: { 456 items: 1 457 } 458 } 459 }); 460 }; 461} 462// 18. testimonial widget carousel 463function testiWidgetCarousel() { 464 if ($('.testimonials-widget .owl-carousel').length) { 465 $('.testimonials-widget .owl-carousel').owlCarousel({ 466 loop: true, 467 margin: 0, 468 nav: false, 469 dots: true, 470 autoplay: true, 471 autoplayHoverPause: true, 472 responsive: { 473 0: { 474 items: 1 475 }, 476 480: { 477 items: 1 478 }, 479 600: { 480 items: 1 481 }, 482 1000: { 483 items: 1 484 } 485 } 486 }); 487 }; 488} 489// 19. single project carousel 490function singleProjectCarousel() { 491 if ($('.single-project-carousel').length) { 492 $('.single-project-carousel').owlCarousel({ 493 loop: true, 494 margin: 0, 495 nav: true, 496 navText: [ 497 '<i class="fa fa-angle-left"></i>', 498 '<i class="fa fa-angle-right"></i>' 499 ], 500 dots: false, 501 autoplay: true, 502 autoplayHoverPause: true, 503 responsive: { 504 0: { 505 items: 1 506 }, 507 480: { 508 items: 1 509 }, 510 600: { 511 items: 1 512 }, 513 1000: { 514 items: 1 515 } 516 } 517 }); 518 }; 519} 520// 20. blog share slide 521function blogShareSlide() { 522 if ($('.share-box.has-slide').length) { 523 $('.share-box.has-slide button').on('click', function() { 524 $(this).parent().find('.share-slide').toggleClass('share-hide share-show'); 525 }); 526 }; 527} 528// 21. responsive video 529function respnsiveVideo() { 530 if ($('.responsive-video-box').length) { 531 $('.responsive-video-box').fitVids(); 532 } 533} 534// 22. price filter 535function priceFilter() { 536 if ($('.range-slider-price').length) { 537 538 var priceRange = document.getElementById('range-slider-price'); 539 540 noUiSlider.create(priceRange, { 541 start: [60, 100], 542 limit: 200, 543 behaviour: 'drag', 544 connect: true, 545 range: { 546 'min': 30, 547 'max': 200 548 } 549 }); 550 551 var limitFieldMin = document.getElementById('min-value-rangeslider'); 552 var limitFieldMax = document.getElementById('max-value-rangeslider'); 553 554 priceRange.noUiSlider.on('update', function(values, handle) { 555 (handle ? limitFieldMax : limitFieldMin).value = values[handle]; 556 }); 557 }; 558} 559// 23. cart touch spin 560function cartTouchSpin() { 561 if ($('.quantity-spinner').length) { 562 $("input.quantity-spinner").TouchSpin({ 563 verticalbuttons: true 564 }); 565 } 566} 567// 24. video fancybox
568function videoFancybox() { 569 if ($("a.video-fancybox").length) { 570 $("a.video-fancybox").on('click', function() { 571 $.fancybox({ 572 'padding': 0, 573 'autoScale': false, 574 'transitionIn': 'none', 575 'transitionOut': 'none', 576 'title': this.title, 577 'width': 680, 578 'height': 495, 579 'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 580 'type': 'swf', 581 openEffect: 'elastic', 582 closeEffect: 'elastic', 583 helpers: { 584 media: {} 585 }, 586 'swf': { 587 'wmode': 'transparent', 588 'allowfullscreen': 'true' 589 } 590 }); 591 592 return false; 593 }); 594 }; 595} 596 597// 25. contact form validation 598function contactFormValidation() { 599 600 if ($('.contact-form').length) { 601 $('.contact-form').validate({ // initialize the plugin 602 rules: { 603 name: { 604 required: true 605 }, 606 email: { 607 required: true, 608 email: true 609 }, 610 phone: { 611 required: true 612 }, 613 requirement: { 614 required: true 615 } 616 }, 617 submitHandler: function(form) { 618 // sending value with ajax request 619 $.post($(form).attr('action'), $(form).serialize(), function(response) { 620 $(form).parent('div').append(response); 621 $(form).find('input[type="text"]').val(''); 622 $(form).find('input[type="email"]').val(''); 623 $(form).find('textarea').val(''); 624 }); 625 return false; 626 } 627 }); 628 } 629} 630// 25. menu active 631function menuActive() { 632 if ($("#menuzord").length) { 633 $("#menuzord").menuzord({ 634 indicatorFirstLevel: '<em></em><em></em><em></em>', 635 indicatorSecondLevel: '<em></em><em></em><em></em>' 636 }); 637 }; 638} 639// 25. header search 640function headerSearchBtn() { 641 if ($('.header .menuzord-menu > li.search-button > a').length) { 642 $('.header .menuzord-menu > li.search-button > a').on('click', function() { 643 $(this).find('.fa').toggleClass('fa-times fa-search'); 644 }); 645 }; 646} 647// 26. health care pack carousel 648 649function healthCarePackCarousel() { 650 if ($('.health-care-pack-carousel').length) { 651 $('.health-care-pack-carousel').owlCarousel({ 652 loop: true, 653 margin: 30, 654 nav: false, 655 navText: [ 656 '<i class="fa fa-angle-left"></i>', 657 '<i class="fa fa-angle-right"></i>' 658 ], 659 dots: false, 660 autoplay: false, 661 autoplayHoverPause: true, 662 responsive: { 663 0: { 664 items: 1 665 }, 666 480: { 667 items: 1 668 }, 669 600: { 670 items: 1 671 }, 672 1000: { 673 items: 2 674 }, 675 1200: { 676 items: 3 677 } 678 } 679 }); 680 } 681} 682// 27. video gallery box 683function videoGalleryBox() { 684 if ($('.video-box').length) { 685 var wrapper = $('.video-box'); 686 var imgLi = wrapper.find('ul.img-list').children('li'); 687 var imgCount = imgLi.length; 688 var mainImg = wrapper.find('.main-box .img-box').children('img'); 689 var videoPreview = wrapper.find('.main-box').find('a.play-video'); 690 691 var videoImg = imgLi.map(function() { 692 return $(this).data('video-img'); 693 }); 694 var videoUrl = imgLi.map(function() { 695 return $(this).data('video-url'); 696 }); 697 var current = 1; 698 699 // setting up values on init 700 videoPreview.attr('href', wrapper.find('ul.img-list').children('li.active').data('video-url')); 701 702 $('.vid-nav').find('a').on('click', function() { 703 var dir = $(this).data('dir'); 704 if (dir === 'next') { 705 current = current + 1; 706 } else { 707 current = current - 1; 708 }; 709 if (current === 0) { 710 current = imgCount; 711 dir = 'next'; 712 } else if (current - 1 === imgCount) { 713 current = 1; 714 }; 715 console.log(current); 716 717 makeSwitch(); 718 719 return false; 720 }); 721 722 723 function makeSwitch() { 724 var i = current - 1; 725 var mainImgSrc = videoImg[i]; 726 var mainVideoSrc = videoUrl[i]; 727 728 imgLi.removeClass('active'); 729 imgLi.eq(i).addClass('active'); 730 mainImg.fadeOut(500, function() { 731 mainImg.attr("src", mainImgSrc); 732 mainImg.fadeIn(500); 733 }); 734 // mainImg.attr('src', mainImgSrc); 735 videoPreview.attr('href', mainVideoSrc); 736 } 737 738 739 }; 740} 741// 28. schedule filter 742function scheduleFilter() { 743 if ($('.schedule-filter').length) { 744 $('.schedule-filter li').find('span').on('click', function() { 745 var filterClass = $(this).parent().data('filter'); 746 747 $('.schedule-filter li').removeClass('active'); 748 $(this).parent().addClass('active'); 749 750 $('.schedule-table').find('.schedule-wrapper').addClass('closed'); 751 $('.schedule-table').find('.schedule-wrapper').removeClass('opened'); 752 753 $('.schedule-table').find(filterClass).addClass('opened'); 754 $('.schedule-table').find(filterClass).removeClass('closed'); 755 }); 756 }; 757} 758// 29. product carousel 759function productCarousel() {
760 if ($('.product-carousel').length) { 761 $('.product-carousel').owlCarousel({ 762 loop: true, 763 margin: 30, 764 nav: true, 765 navText: [ 766 '<i class="fa fa-angle-left"></i>', 767 '<i class="fa fa-angle-right"></i>' 768 ], 769 dots: false, 770 autoplay: true, 771 autoplayHoverPause: true, 772 responsive: { 773 0: { 774 items: 1 775 }, 776 480: { 777 items: 1 778 }, 779 600: { 780 items: 2 781 }, 782 1000: { 783 items: 3 784 } 785 } 786 }); 787 } 788} 789// 30. gallery masonary layout 790function galleryMasonaryLayout() { 791 if ($('.masonary-layout').length) { 792 $('.masonary-layout').isotope({ 793 layoutMode: 'masonry' 794 }); 795 } 796 797 if ($('.post-filter').length) { 798 $('.post-filter li').children('span').on('click', function() { 799 var Self = $(this); 800 var selector = Self.parent().attr('data-filter'); 801 $('.post-filter li').children('span').parent().removeClass('active'); 802 Self.parent().addClass('active'); 803 $('.filter-layout').isotope({ 804 filter: selector, 805 stagger: 30, 806 transitionDuration: 400, 807 hiddenStyle: { 808 opacity: 0 809 }, 810 visibleStyle: { 811 opacity: 1 812 } 813 }); 814 return false; 815 }); 816 } 817 818 if ($('.post-filter.has-dynamic-filter-counter').length) { 819 // var allItem = $('.single-filter-item').length; 820 821 var activeFilterItem = $('.post-filter.has-dynamic-filter-counter').find('li'); 822 823 activeFilterItem.each(function() { 824 var filterElement = $(this).data('filter'); 825 console.log(filterElement); 826 var count = $('.gallery-content').find(filterElement).length; 827 828 $(this).children('span').append('<span class="count"><b>' + count + '</b></span>'); 829 }); 830 }; 831} 832 833// 31. single product careousel 834function singleProductCarousel() { 835 if ($('.single-product-carousel-content-box').length && $('.single-product-carousel-thumbnail-box').length) { 836 837 var $sync1 = $(".single-product-carousel-content-box"), 838 $sync2 = $(".single-product-carousel-thumbnail-box"), 839 flag = false, 840 duration = 1000; 841 842 $sync1 843 .owlCarousel({ 844 items: 1, 845 margin: 0, 846 nav: false, 847 dots: false 848 }) 849 .on('changed.owl.carousel', function(e) { 850 if (!flag) { 851 flag = true; 852 $sync2.trigger('to.owl.carousel', [e.item.index, duration, true]); 853 flag = false; 854 } 855 }); 856 857 $sync2 858 .owlCarousel({ 859 margin: 10, 860 items: 2, 861 nav: false, 862 dots: false, 863 navText: [ 864 '<i class="fa fa-angle-left"></i>', 865 '<i class="fa fa-angle-right"></i>' 866 ], 867 center: false, 868 responsive: { 869 0: { 870 items: 1, 871 autoWidth: false 872 }, 873 480: { 874 items: 2, 875 center: false, 876 autoWidth: false 877 }, 878 600: { 879 items: 3, 880 autoWidth: false 881 }, 882 1000: { 883 items: 3, 884 autoWidth: false 885 } 886 }, 887 }) 888 .on('click', '.owl-item', function() { 889 $sync1.trigger('to.owl.carousel', [$(this).index(), duration, true]); 890 891 }) 892 .on('changed.owl.carousel', function(e) { 893 if (!flag) { 894 flag = true; 895 $sync1.trigger('to.owl.carousel', [e.item.index, duration, true]); 896 flag = false; 897 } 898 }); 899 900 }; 901} 902// 32. scoll to target 903function scrollToTarget() { 904 if ($('.scroll-to-target').length) { 905 $(".scroll-to-target").on('click', function() { 906 var target = $(this).attr('data-target'); 907 // animate 908 $('html, body').animate({ 909 scrollTop: $(target).offset().top 910 }, 1000); 911 912 }); 913 } 914} 915// 33. custom progress bar 916function CustomProgressBar() { 917 if ($('.pgrs-bar').length) { 918 919 $('.pgrs-bar').waypoint(function() { 920 $('.pgrs-bar').each(function() { 921 //======== CONFIGURATION WINDOW 922 //======== i made this configuration code here you can change value and experiment 923 var x = 290; //set the x - center here 924 var y = 200; //set the y - center here 925 var r = 160; //set the radius here 926 var linewidth = 80; //set the line width here 927 var Self = $(this); 928 var SET_PERCENTAGE = Self.children('.pgrs-bar-cv').data('percentage-value');
929 var bar_color = Self.children('.pgrs-bar-cv').data('bar-color'); 930 var alt_color = Self.children('.pgrs-bar-cv').data('bar-alt-color'); 931 var track_color = Self.children('.pgrs-bar-cv').data('track-color'); 932 var ball_color = Self.children('.pgrs-bar-cv').data('ball-color'); 933 934 //======== 935 var c = Self.children('.pgrs-bar-cv').get(0); 936 var id = Self.attr('id'); 937 var status = $('#' + id + '.pgrs-bar-status'); 938 var loaded = false; 939 940 var ctx = c.getContext("2d"); 941 window.onload = function() { 942 943 loaded = true; 944 } 945 946 947 var ROTATION = 0; 948 949 function setcanvas() { 950 951 ctx.translate(x, y); 952 ctx.rotate((Math.PI / 180) * (-ROTATION)); 953 ctx.translate(-x, -y); 954 955 956 957 ctx.clearRect(0, 0, c.width, c.height); 958 959 960 ctx.beginPath(); 961 ctx.lineWidth = 80; 962 ctx.strokeStyle = track_color; 963 ctx.arc(x, y, r, 0, 2 * Math.PI); 964 ctx.stroke(); 965 966 967 968 ctx.beginPath(); 969 ctx.lineWidth = 4; 970 ctx.strokeStyle = "black"; 971 ctx.arc(x, y, r + (linewidth / 2), 0, 2 * Math.PI); 972 ctx.globalAlpha = 0.02; 973 ctx.stroke(); 974 975 ctx.beginPath(); 976 ctx.lineWidth = 4; 977 ctx.strokeStyle = "black"; 978 ctx.arc(x, y, r - (linewidth / 2), 0, 2 * Math.PI); 979 ctx.stroke(); 980 } 981 982 function getPoint(c1, c2, radius, angle) { 983 return [c1 + Math.cos(angle) * radius, c2 + Math.sin(angle) * radius]; 984 } 985 986 function setPercent(uplimit) { 987 ctx.beginPath(); 988 ctx.translate(x, y); 989 ROTATION = 270; 990 ctx.rotate((Math.PI / 180) * ROTATION); 991 ctx.translate(-x, -y); 992 ctx.lineWidth = linewidth; //40 993 var my_gradient = ctx.createLinearGradient(-0, 0, 0, 520); 994 my_gradient.addColorStop(0, bar_color); 995 my_gradient.addColorStop(1, alt_color); 996 997 ctx.strokeStyle = my_gradient; 998 ctx.arc(x, y, r, (Math.PI / 180) * (uplimit), 0); 999 ctx.globalAlpha = 1; 1000 ctx.stroke(); 1001 1002 1003 ctx.beginPath(); 1004 var a = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[0]; 1005 var b = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[1]; 1006 var nr = linewidth / 2; 1007 ctx.lineWidth = 2; 1008 ctx.strokeStyle = track_color; 1009 ctx.arc(a, b, nr, 0, 2 * Math.PI); 1010 ctx.fillStyle = track_color; 1011 ctx.fill(); 1012 ctx.stroke(); 1013 1014 ctx.beginPath(); 1015 var a = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[0]; 1016 var b = getPoint(x, y, r, (Math.PI / 180) * (uplimit))[1]; 1017 nr = linewidth / 2 - 6; 1018 ctx.lineWidth = 14; 1019 ctx.strokeStyle = track_color; 1020 ctx.arc(a, b, nr, 0, 2 * Math.PI); 1021 ctx.fillStyle = ball_color; 1022 ctx.fill(); 1023 ctx.stroke(); 1024 1025 } 1026 1027 function callcanvas(degree) { 1028 setcanvas(); 1029 setPercent(360 - degree); 1030 } 1031 var degree = (SET_PERCENTAGE * 360) / 100; 1032 var degree = parseInt(degree, 10); 1033 var start = 0; 1034 var it = window.setInterval(function() { 1035 callcanvas(start); 1036 start++; 1037 if (start == degree) { 1038 start = degree; 1039 window.clearInterval(it); 1040 } 1041 if (loaded) { 1042 var startVar = ((start * 100) / 360); 1043 var startVar = parseInt(startVar, 10); 1044 status.html( startVar + '%'); 1045 }; 1046 }, 1); 1047 $(this).children('.pgrs-bar-cv').removeClass('pgrs-bar-cv'); 1048 }); 1049 }, { offset: '85%' }); 1050 1051 1052 }; 1053} 1054// 34. bmi calculator 1055function thmBmiCalculator() { 1056 if ($('.bmi-calc-form').length) { 1057 1058 function bmi(w, hFeet, hInch, r) { 1059 var weight = w, 1060 feet = parseInt(hFeet * 12, 10), 1061 inches = parseInt(hInch, 10), 1062 height = feet + inches, 1063 output = r, 1064 formula = ~~(weight / (height * height) * 703 * 100) / 100; 1065 1066 output.val(formula); 1067 1068 console.log(output); 1069 } 1070 1071 $('.bmi-calc-form').each(function() { 1072 $(this).on('submit', function(e) { 1073 var bmiForm = $(this); 1074 var bmiWeight = bmiForm.find('.input-weight').val(); 1075 var bmiHeightFeet = bmiForm.find('.input-height-feet').val(); 1076 var bmiHeightInch = bmiForm.find('.input-height-inch').val(); 1077 var bmiResult = bmiForm.find('.input-result'); 1078 1079 bmi(bmiWeight, bmiHeightFeet, bmiHeightInch, bmiResult); 1080 1081 // return false; 1082 e.preventDefault(); 1083 }); 1084 }); 1085 1086 }; 1087} 1088// 35. mailchimp active 1089function thmMailchimp() { 1090 if ($('.mailchimp-form').length) { 1091 $('.mailchimp-form').each(function() { 1092 var mailChimpWrapper = $(this); 1093 1094 mailChimpWrapper.validate({ // initialize the plugin 1095 rules: { 1096 fname: { 1097 required: true 1098 }, 1099 email: { 1100 required: true, 1101 email: true 1102 } 1103 }, 1104 submitHandler: function(form) { 1105 // sending value with ajax request 1106 $.post($(form).attr('action'), $(form).serialize(), function(response) { 1107 $(form).parent('div').append(response); 1108 $(form).find('input[type="text"]').val(''); 1109 $(form).find('input[type="email"]').val(''); 1110 $(form).find('textarea').val(''); 1111 }); 1112 console.log($(form).serialize()); 1113 return false; 1114 } 1115 }); 1116 }); 1117 }; 1118} 1119// 36. mobile navigation 1120function mobileNavToggler() { 1121 if ($('.mainmenu-holder').length) { 1122 $('.mainmenu-holder .nav-footer .menu-expander').on('click', function() { 1123 $('.mainmenu-holder .nav-header').toggleClass('closed opened'); 1124 return false; 1125 }); 1126 $('.mainmenu-holder .nav-header .navigation li.dropdown').children('a').append(function() { 1127 return '<button class="dropdown-expander"><i class="fa fa-bars"></i></button>'; 1128 }); 1129 $('.mainmenu-holder .nav-header .navigation .dropdown-expander').on('click', function() { 1130 var Self = $(this); 1131 Self.parent().parent().children('.submenu').toggleClass('closed opened'); 1132 return false; 1133 }); 1134 } 1135} 1136 1137// 37. dynamic divider 1138function dynamicDivider() { 1139 if ($('.has-dynamic-divider').length) { 1140 var wrapper = $('.has-dynamic-divider'); 1141 var countElement = $('.has-dynamic-divider').data('count-element'); 1142 // wrapper.find('.dynamic-divider-element:nth-child('+countElement+'n)').after("<span class='divider'></span>"); 1143 var divs = wrapper.find('.dynamic-divider-element'); 1144 for (var i = 0; i < divs.length; i += countElement) { 1145 divs.slice(i, i + 3).wrapAll("<div class='divider clearfix'></div>"); 1146 } 1147 1148 } 1149} 1150 1151 1152 1153// instance of fuction while Document ready event
1154jQuery(document).on('ready', function() { 1155 (function($) { 1156 revolutionSliderActiver(); 1157 accrodion(); 1158 selectMenu(); 1159 CounterNumberChanger(); 1160 contactFormValidation(); 1161 fleetGallery(); 1162 GalleryFancyboxActivator(); 1163 typed(); 1164 mobileNavToggler(); 1165 testimonialsCarosuleGardener(); 1166 toolTip(); 1167 singleFeaturedHover(); 1168 languageSwitcher(); 1169 relatedProjectCarosule(); 1170 singleProjectCarousel(); 1171 aboutCarousel(); 1172 blogShareSlide(); 1173 respnsiveVideo(); 1174 priceFilter(); 1175 testiWidgetCarousel(); 1176 cartTouchSpin(); 1177 videoFancybox(); 1178 contactFormValidation(); 1179 menuActive(); 1180 headerSearchBtn(); 1181 healthCarePackCarousel(); 1182 videoGalleryBox(); 1183 teamCarouselStyleTwo(); 1184 scheduleFilter(); 1185 productCarousel(); 1186 singleProductCarousel(); 1187 dynamicDivider(); 1188 scrollToTarget(); 1189 CustomProgressBar(); 1190 thmBmiCalculator(); 1191 thmMailchimp(); 1192 1193 })(jQuery); 1194}); 1195 1196// instance of fuction while Window Load event 1197jQuery(window).on('load', function() { 1198 (function($) { 1199 clientCarousel(); 1200 galleryMasonaryLayout(); 1201 })(jQuery); 1202}); 1203 1204// instance of fuction while Window Scroll event 1205jQuery(window).on('scroll', function() { 1206 (function($) { 1207 stickyHeader(); 1208 })(jQuery); 1209});
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.