1/*************************************************** 2==================== JS INDEX ====================== 3**************************************************** 401. PreLoader Js 502. Mobile Menu Js 603. Sticky Js 704. Backtotop Js 805. Common Js 906. Offcanvas Js 1007. Search Js 1108. Cartmini Js 1209. Filter Js 1310. Body overlay Js 1411. Range slider Js 1512. Nice Select Js 1613. Year change slider Js 1714. MagnificPopup Js 1815. Wow Js 1916. Ecommerce js 2017. Line Animation Js 2118. Counter Js 2219. Header height Js 2320. Click btn Js 2421. Password Toggle Js 2522. Select 2 Js 2623. Date and time Js 2724. Calernder Js 2825. Chart Js 2926. Scroll nav class add 3027. Faq class add 3128. Show more/ Show less js 32****************************************************/ 33 34(function ($) { 35 "use strict"; 36 37 var windowOn = $(window); 38 39 //////////////////////////////////////////////////// 40 // 01. PreLoader Js 41 windowOn.on('load', function () { 42 $("#loading").fadeOut(500); 43 }); 44 45 46 //////////////////////////////////////////////////// 47 // 02. Mobile menu js 48 if ($('.tp-main-menu-content').length && $('.tp-main-menu-mobile').length) { 49 let navContent = document.querySelector(".tp-main-menu-content").outerHTML; 50 let mobileNavContainer = document.querySelector(".tp-main-menu-mobile"); 51 mobileNavContainer.innerHTML = navContent; 52 53 let arrow = $(".tp-main-menu-mobile .has-dropdown > a"); 54 55 arrow.each(function () { 56 let self = $(this); 57 let arrowBtn = document.createElement("BUTTON"); 58 arrowBtn.classList.add("dropdown-toggle-btn"); 59 60 // Append the arrow button after the link 61 self[0].appendChild(arrowBtn); 62 63 function toggleDropdown(e) { 64 e.preventDefault(); 65 let self = $(this); 66 let parent = self.parent(); 67 let submenu = parent.children(".tp-submenu, .tp-megamenu-main"); 68 69 self.toggleClass("dropdown-opened"); 70 parent.toggleClass("expanded"); 71 parent.parent().addClass("dropdown-opened").siblings().removeClass("dropdown-opened").find(".tp-submenu, .tp-megamenu-main").slide
71Up(); 72 73 submenu.slideToggle(); 74 } 75 76 // Add event listeners to both the link and the button 77 self.on("click", toggleDropdown); 78 $(arrowBtn).on("click", toggleDropdown); 79 }); 80 } 81 82 // Mega menu hover width 83 var homeDemoMenu = $('.main-menu .tp-megamenu-main'); 84 85 homeDemoMenu.each(function(){ 86 if($(this).children('.megamenu-demo-conteiner').length > 0){ 87 $(this).addClass('tp-megamenu-container') 88 } 89 90 if($(this).children('.megamenu-demo-academics').length > 0){ 91 $(this).addClass('tp-megamenu-academics') 92 } 93 94 if($(this).children('.megamenu-demo-courses').length > 0){ 95 $(this).addClass('tp-megamenu-courses') 96 } 97 98 if($(this).children('.megamenu-demo-fullwidth').length > 0){ 99 $(this).addClass('tp-megamenu-fullwidth') 100 } 101 102 if($(this).children('.megamenu-demo-small').length > 0){ 103 $(this).addClass('tp-megamenu-small') 104 } 105 }) 106 107 108 //////////////////////////////////////////////////// 109 // 03. Sticky Header Js 110 windowOn.on('scroll', function () { 111 var scroll = $(window).scrollTop(); 112 if (scroll < 200) { 113 $("#header-sticky").removeClass("tp-header-sticky"); 114 } else { 115 $("#header-sticky").addClass("tp-header-sticky"); 116 } 117 118 }); 119 120 121 ///////////////////////////////////////////////// 122 // 04. back_to_top////////////////// 123 function back_to_top() { 124 var btn = $('#back_to_top'); 125 var btn_wrapper = $('.back-to-top-wrapper'); 126 127 windowOn.scroll(function () { 128 if (windowOn.scrollTop() > 300) { 129 btn_wrapper.addClass('back-to-top-btn-show'); 130 } else { 131 btn_wrapper.removeClass('back-to-top-btn-show'); 132 } 133 }); 134 135 btn.on('click', function (e) { 136 e.preventDefault(); 137 $('html, body').animate({ scrollTop: 0 }, '300'); 138 }); 139 } 140 back_to_top(); 141 142 143 //////////////////////////////////////////////////// 144 // 05. Common Js 145 $("[data-background").each(function () { 146 $(this).css("background-image", "url( " + $(this).attr("data-background") + " )"); 147 }); 148 149 $("[data-width]").each(function () { 150 $(this).css("width", $(this).attr("data-width")); 151 }); 152 153 $("[data-bg-color]").each(function () { 154 $(this).css("background-color", $(this).attr("data-bg-color")); 155 }); 156 157 $("[data-text-color]").each(function () { 158 $(this).css("color", $(this).attr("data-text-color")); 159 }); 160 161 162 //////////////////////////////////////////////////// 163 // 06. Offcanvas Js 164 $(".offcanvas-open-btn").on("click", function () { 165 $(".offcanvas__area").addClass("offcanvas-opened"); 166 $(".body-overlay").addClass("opened"); 167 }); 168 $(".offcanvas-close-btn").on("click", function () { 169 $(".offcanvas__area").removeClass("offcanvas-opened"); 170 $(".body-overlay").removeClass("opened"); 171 }); 172 $(".body-overlay").on("click", function () { 173 $(".offcanvas__area").removeClass("offcanvas-opened"); 174 $(".body-overlay").removeClass("opened"); 175 }); 176 177 178 //////////////////////////////////////////////////// 179 // 07. Search Js 180 $(".tp-search-open-btn").on("click", function () { 181 $(".tp-search-area").addClass("opened"); 182 $(".body-overlay").addClass("opened"); 183 }); 184 $(".tp-search-close-btn").on("click", function () { 185 $(".tp-search-area").removeClass("opened"); 186 $(".body-overlay").removeClass("opened"); 187 }); 188 189 190 //////////////////////////////////////////////////// 191 // 08. cartmini Js 192 $(".cartmini-open-btn").on("click", function () { 193 $(".cartmini__area").addClass("cartmini-opened"); 194 $(".body-overlay").addClass("opened"); 195 }); 196 $(".cartmini-close-btn").on("click", function () { 197 $(".cartmini__area").removeClass("cartmini-opened"); 198 $(".body-overlay").removeClass("opened"); 199 }); 200 201 /////////////////////// 202 // filter offcanvas 203 $(".filter-open-btn").on("click", function () { 204 $(".filter__area").addClass("filter-opened"); 205 }); 206 $(".filter-close-btn").on("click", function () { 207 $(".filter__area").removeClass("filter-opened"); 208 }); 209 210 //////////////////////////////////////////////////// 211 // 09. filter show 212 $(".filter-show-btn").on("click", function () { 213 $(".tp-filter-offcanvas-area").addClass("offcanvas-opened"); 214 $(".body-overlay").addClass("opened"); 215 }); 216 217 $(".filter-close-btn").on("click", function () { 218 $(".tp-filter-offcanvas-area").removeClass("offcanvas-opened"); 219 $(".body-overlay").removeClass("opened"); 220 }); 221 222 $(".filter-show-dropdown-btn").on("click", function () { 223 $(".tp-filter-dropdown-area").toggleClass('filter-dropdown-opened'); 224 }); 225 226 227 //////////////////////////////////////////////////// 228 // 10. Body overlay Js 229 $(".body-overlay").on("click", function () { 230 $(".offcanvas__area").removeClass("offcanvas-opened"); 231 $(".tp-search-area").removeClass("opened"); 232 $(".cartmini__area").removeClass("cartmini-opened"); 233 $(".tp-filter-offcanvas-area").removeClass("offcanvas-opened"); 234 $(".body-overlay").removeClass("opened"); 235 }); 236 237 238 /////////////////////////////////////////// 239 // 11. Range slider 240 if ($('#slider-range').length > 0) { 241 $("#slider-range").slider({ 242 range: true, 243 min: 0, 244 max: 500, 245 values: [75, 300], 246 slide: function (event, ui) { 247 $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); 248 } 249 }); 250 $("#amount").val("$" + $("#slider-range").slider("values", 0) + 251 " - $" + $("#slider-range").slider("values", 1)); 252 253 $("#slider-range-offcanvas").slider({ 254 range: true, 255 min: 0, 256 max: 500, 257 values: [75, 300], 258 slide: function (event, ui) { 259 $("#amount-offcanvas").val("$" + ui.values[0] + " - $" + ui.values[1]); 260 } 261 }); 262 $("#amount-offcanvas").val("$" + $("#slider-range-offcanvas").slider("values", 0) + 263 " - $" + $("#slider-range-offcanvas").slider("values", 1)); 264 } 265 266 267 //////////////////////////////////////////////////// 268 // 12. Nice Select Js 269 $('select').niceSelect(); 270 $('.tpd-select select').niceSelect(); 271 272 273 //////////////////////////////////////////////////// 274 // Active Class 275 $('.tp-plan-4-item').on('mouseenter', function () { 276 $(this).addClass('active').parent().siblings().find('.tp-plan-4-item').removeClass('active'); 277 }) 278 279 if ($('.tp-header-user-hover').length > 0) { 280 window.addEventListener('click', function(e) { 281 let clickedElement = e.target; 282 283 $('.tp-header-user-hover').each(function() { 284 if (this.contains(clickedElement)) { 285 $(this).toggleClass('active'); 286 } else { 287 $(this).removeClass('active'); 288 } 289 }); 290 }); 291 } 292 293 // class add js 294 $('.tp-course-details-2-nav nav ul li').on('click', function () { 295 $(this).addClass('current').siblings().removeClass('current'); 296 }); 297 298 299 //////////////////////////////////////////////////// 300 // . language 301 if ($("#header-bottom__lang-toggle").length > 0) { 302 window.addEventListener('click', function(e){ 303 304 if (document.getElementById('header-bottom__lang-toggle').contains(e.target)){ 305 $(".header-bottom__lang-submenu, .header-bottom__lang-submenu-2").toggleClass("open"); 306 } 307 else{ 308 $(".header-bottom__lang-submenu, .header-bottom__lang-submenu-2").removeClass("open"); 309 } 310 }); 311 } 312 313 314 // Function to hide the parent section 315 $('.hide-button').on('click', function(){
316 $('.tp-announcement-area').slideUp(200); 317 }); 318 319 $(document).ready(function(){ 320 $('.close').on('click', function(){ 321 $(this).toggleClass('active'); 322 $('.tpd-continue-learning-sidebar').toggleClass('d-none d-block'); 323 }); 324 }); 325 326 327 // home one 328 var slider = new Swiper('.tp-slider-active', { 329 slidesPerView: 1, 330 effect: 'fade', 331 loop: true, 332 autoplay: { 333 delay: 3500, 334 }, 335 // Navigation arrows 336 pagination: { 337 el: ".tp-program-dot", 338 clickable: true, 339 }, 340 }); 341 342 343 // home one 344 var slider = new Swiper('.tp-program-active', { 345 slidesPerView: 3, 346 spaceBetween: 30, 347 loop: true, 348 // Navigation arrows 349 pagination: { 350 el: ".tp-program-dot", 351 clickable: true, 352 }, 353 breakpoints: { 354 '1200': { 355 slidesPerView: 3, 356 }, 357 '992': { 358 slidesPerView: 3, 359 }, 360 '768': { 361 slidesPerView: 2, 362 }, 363 '576': { 364 slidesPerView: 1, 365 }, 366 '0': { 367 slidesPerView: 1, 368 }, 369 }, 370 }); 371 372 373 // home one 374 var swiper = new Swiper('.tp-testimonial-active', { 375 slidesPerView: 1, 376 spaceBetween: 10, 377 loop: true, 378 // Navigation arrows 379 navigation: { 380 nextEl: ".tp-testimonial-next", 381 prevEl: ".tp-testimonial-prev", 382 }, 383 autoplay: { 384 delay: 2000, 385 }, 386 breakpoints: { 387 '1200': { 388 slidesPerView: 1, 389 }, 390 '992': { 391 slidesPerView: 1, 392 }, 393 '768': { 394 slidesPerView: 1, 395 }, 396 '576': { 397 slidesPerView: 1, 398 }, 399 '0': { 400 slidesPerView: 1, 401 }, 402 }, 403 }); 404 405 406 // home one 407 var swiper = new Swiper(".tp-instagram-active", { 408 slidesPerView: 5, 409 spaceBetween: 10, 410 freeMode: false, 411 loop: true, 412 autoplay: { 413 delay: 3500, 414 }, 415 breakpoints: { 416 '1200': { 417 slidesPerView: 5, 418 }, 419 '992': { 420 slidesPerView: 4, 421 }, 422 '768': { 423 slidesPerView: 3, 424 }, 425 '576': { 426 slidesPerView: 2, 427 }, 428 '0': { 429 slidesPerView: 2, 430 }, 431 }, 432 }); 433 434 435 // campus life 436 var swiper = new Swiper(".tp-campus-life-active", { 437 slidesPerView: 'auto', 438 spaceBetween: 130, 439 loop: true, 440 navigation: { 441 nextEl: ".tp-campus-next", 442 prevEl: ".tp-campus-prev", 443 }, 444 breakpoints: { 445 '1200': { 446 spaceBetween: 130, 447 }, 448 '768': { 449 spaceBetween: 80, 450 }, 451 '400': { 452 spaceBetween: 50, 453 }, 454 }, 455 }); 456 457 458 // home Two 459 var slider = new Swiper('.tp-team-2-active', { 460 slidesPerView: 4, 461 spaceBetween: 30, 462 loop: true, 463 autoplay: { 464 delay: 5000, 465 }, 466 // Navigation arrows 467 navigation: { 468 nextEl: ".tp-team-2-next", 469 prevEl: ".tp-team-2-prev", 470 }, 471 breakpoints: { 472 '1200': { 473 slidesPerView: 4, 474 }, 475 '992': { 476 slidesPerView: 3, 477 }, 478 '768': { 479 slidesPerView: 2, 480 }, 481 '576': { 482 slidesPerView: 2, 483 }, 484 '0': { 485 slidesPerView: 1, 486 }, 487 }, 488 }); 489 490 491 // home Two 492 $('.tp-testimonial-2-active').slick({ 493 slidesToShow: 1, 494 slidesToScroll: 1, 495 arrows: false, 496 fade: false, 497 asNavFor: '.tp-testimonial-2-avatar-active' 498 }); 499 $('.tp-testimonial-2-avatar-active').slick({ 500 slidesToShow: 5, 501 slidesToScroll: 1, 502 asNavFor: '.tp-testimonial-2-active', 503 dots: false, 504 centerMode: true, 505 centerPadding: '0px', 506 prevArrow: '<button type="button" class="slick-prev"><i class="fa-solid fa-angle-left"></i></button>', 507 nextArrow: '<button type="button" class="slick-next"><i class="fa-solid fa-angle-right"></i></button>', 508 focusOnSelect: true, 509 responsive: [ 510 { 511 breakpoint: 500, 512 settings: { 513 slidesToShow: 3, 514 slidesToScroll: 1, 515 }, 516 }, 517 ], 518 }); 519 520 521 // home Four 522 var slider = new Swiper('.tp-program-4-active', { 523 slidesPerView: 4, 524 spaceBetween: 10, 525 loop: true, 526 autoplay: { 527 delay: 5000, 528 }, 529 // Navigation arrows 530 navigation: { 531 nextEl: ".tp-program-4-next", 532 prevEl: ".tp-program-4-prev", 533 }, 534 breakpoints: { 535 '1200': { 536 slidesPerView: 4, 537 }, 538 '992': { 539 slidesPerView: 3, 540 }, 541 '768': { 542 slidesPerView: 2, 543 }, 544 '576': { 545 slidesPerView: 2, 546 }, 547 '0': { 548 slidesPerView: 1, 549 }, 550 }, 551 }); 552 553 554 // home Five 555 $('.tp-slider-5-active').slick({ 556 slidesToShow: 1, 557 slidesToScroll: 1, 558 arrows: false, 559 fade: true, 560 asNavFor: '.tp-slider-5-arrow' 561 }); 562 $('.tp-slider-5-arrow').slick({ 563 slidesToShow: 3, 564 slidesToScroll: 1, 565 asNavFor: '.tp-slider-5-active', 566 dots: false, 567 centerMode: false, 568 focusOnSelect: true, 569 centerPadding:"5px",
570 arrows: false, 571 responsive: [ 572 { 573 breakpoint: 500, 574 settings: { 575 slidesToShow: 2, 576 slidesToScroll: 1, 577 centerPadding: '15px', 578 }, 579 }, 580 ], 581 }); 582 583 584 // home Five 585 var slider = new Swiper('.tp-brand-5-active', { 586 slidesPerView: 6, 587 loop: true, 588 autoplay: { 589 delay: 5000, 590 }, 591 breakpoints: { 592 '1200': { 593 slidesPerView: 6, 594 }, 595 '992': { 596 slidesPerView: 4, 597 }, 598 '768': { 599 slidesPerView: 3, 600 }, 601 '576': { 602 slidesPerView: 2, 603 }, 604 '0': { 605 slidesPerView: 1, 606 }, 607 }, 608 }); 609 610 611 // home Five 612 var slider = new Swiper('.tp-trainer-5-active', { 613 slidesPerView: 2, 614 spaceBetween: 30, 615 loop: true, 616 autoplay: { 617 delay: 3000, 618 }, 619 breakpoints: { 620 '1200': { 621 slidesPerView: 2, 622 }, 623 '992': { 624 slidesPerView: 2, 625 }, 626 '768': { 627 slidesPerView: 2, 628 }, 629 '576': { 630 slidesPerView: 2, 631 }, 632 '0': { 633 slidesPerView: 1, 634 }, 635 }, 636 }); 637 638 639 // shop banner 640 var slider = new Swiper('.tp-shop-banner-active', { 641 slidesPerView: 1, 642 spaceBetween: 30, 643 loop: true, 644 645 pagination: { 646 el: ".tp-shop-banner-dot", 647 clickable: true, 648 }, 649 }); 650 651 652 ////////////////////////////////////////////////////// 653 // 13. year change slider js 654 $(function() { 655 $('.slider-for').slick({ 656 slidesToShow: 1, 657 slidesToScroll: 1, 658 arrows: false, 659 fade: true, 660 asNavFor: '.slider-nav' 661 }); 662 $('.slider-nav').slick({ 663 slidesToShow: 3, 664 slidesToScroll: 1, 665 asNavFor: '.slider-for', 666 arrows: false, 667 centerMode: true, 668 focusOnSelect: true, 669 responsive: [ 670 { 671 breakpoint: 576, 672 settings: { 673 slidesToShow: 3, 674 } 675 } 676 ] 677 }); 678 }); 679 680 681 ////////////////////////////////////////////////// 682 // 14. magnificPopup img view 683 $('.popup-image').magnificPopup({ 684 type: 'image', 685 gallery: { 686 enabled: true 687 } 688 }); 689 690 /* magnificPopup video view */ 691 $(".popup-video").magnificPopup({ 692 type: "iframe", 693 }); 694 695 696 //////////////////////////////////////////////////// 697 // 15. Wow Js 698 new WOW().init(); 699 700 701 ///////////////////////////////////////////// 702 // 16. Ecommerce js 703 function tp_ecommerce() { 704 $('.tp-cart-minus').on('click', function () { 705 var $input = $(this).parent().find('input'); 706 var count = parseInt($input.val()) - 1; 707 count = count < 1 ? 1 : count; 708 $input.val(count); 709 $input.change(); 710 return false; 711 }); 712 713 $('.tp-cart-plus').on('click', function () { 714 var $input = $(this).parent().find('input'); 715 $input.val(parseInt($input.val()) + 1); 716 $input.change(); 717 return false; 718 }); 719 720 721 $('.tp-checkout-payment-item label').on('click', function () { 722 $(this).siblings('.tp-checkout-payment-desc').slideToggle(400); 723 724 }); 725 726 727 $('.tp-color-variation-btn').on('click', function () { 728 $(this).addClass('active').siblings().removeClass('active'); 729 }); 730 731 732 $('.tp-size-variation-btn').on('click', function () { 733 $(this).addClass('active').siblings().removeClass('active'); 734 }); 735 736 //////////////////////////////////////////////////// 737 // 17. Show Login Toggle Js 738 $('.tp-checkout-login-form-reveal-btn').on('click', function () { 739 $('#tpReturnCustomerLoginForm').slideToggle(400); 740 }); 741 742 //////////////////////////////////////////////////// 743 // 18. Show Coupon Toggle Js 744 $('.tp-checkout-coupon-form-reveal-btn').on('click', function () { 745 $('#tpCheckoutCouponForm').slideToggle(400); 746 }); 747 748 //////////////////////////////////////////////////// 749 // 19. Create An Account Toggle Js 750 $('#cbox').on('click', function () { 751 $('#cbox_info').slideToggle(900); 752 }); 753 754 //////////////////////////////////////////////////// 755 // 20. Shipping Box Toggle Js 756 $('#ship-box').on('click', function () { 757 $('#ship-box-info').slideToggle(1000); 758 }); 759 760 } 761 tp_ecommerce(); 762 763 764 //////////////////////////////////////////////////// 765 // 17. Line Animation Js 766 if ($('#productTabMarker').length > 0) { 767 function tp_tab_line_2(){ 768 var marker = document.querySelector('#productTabMarker'); 769 var item = document.querySelectorAll('.tp-product-tab button'); 770 var itemActive = document.querySelector('.tp-product-tab .nav-link.active'); 771 772 // rtl settings 773 var tp_rtl = localStorage.getItem('tp_dir'); 774 let rtl_setting = tp_rtl == 'rtl' ? 'right' : 'left'; 775 776 function indicator(e){ 777 marker.style.left = e.offsetLeft+"px"; 778 marker.style.width = e.offsetWidth+"px"; 779 } 780 781 782 item.forEach(link => { 783 link.addEventListener('click', (e)=>{ 784 indicator(e.target); 785 }); 786 }); 787 788 var activeNav = $('.nav-link.active'); 789 var activewidth = $(activeNav).width(); 790 var activePadLeft = parseFloat($(activeNav).css('padding-left')); 791 var activePadRight = parseFloat($(activeNav).css('padding-right')); 792 var totalWidth = activewidth + activePadLeft + activePadRight; 793 794 var precedingAnchorWidth = anchorWidthCounter(); 795 796 797 $(marker).css('display','block'); 798 799 $(marker).css('width', totalWidth); 800 801 function anchorWidthCounter() {
802 var anchorWidths = 0; 803 var a; 804 var aWidth; 805 var aPadLeft; 806 var aPadRight; 807 var aTotalWidth; 808 $('.tp-product-tab button').each(function(index, elem) { 809 var activeTest = $(elem).hasClass('active'); 810 marker.style.left = elem.offsetLeft+"px"; 811 if(activeTest) { 812 // Break out of the each function. 813 return false; 814 } 815 816 a = $(elem).find('button'); 817 aWidth = a.width(); 818 aPadLeft = parseFloat(a.css('padding-left')); 819 aPadRight = parseFloat(a.css('padding-right')); 820 aTotalWidth = aWidth + aPadLeft + aPadRight; 821 822 anchorWidths = anchorWidths + aTotalWidth; 823 824 }); 825 826 return anchorWidths; 827 } 828 } 829 tp_tab_line_2(); 830 } 831 832 833 //////////////////////////////////////////////////// 834 // 18. Counter Js 835 new PureCounter(); 836 new PureCounter({ 837 filesizing: true, 838 selector: ".filesizecount", 839 pulse: 2, 840 }); 841 842 843 ////////////////////////////////////////////////// 844 // 19. Header height 845 if ($('.tp-header-height').length > 0) { 846 var headerHeight = document.querySelector(".tp-header-height"); 847 var setHeaderHeight = headerHeight.offsetHeight; 848 $(".tp-header-height").each(function () { 849 $(this).css({ 850 'height': setHeaderHeight + 'px' 851 }); 852 }); 853 } 854 855 856 ////////////////////////////////////////////////// 857 // 20. Click btn Js 858 (function () { 859 var actions = $('.tpd-action-inexact-btn'); 860 actions.each(function () { 861 var action = $(this), 862 button = action.find('.click'), 863 body = action.find('.tpd-action-click-tooltip'); 864 button.on('click', function (e) { 865 e.stopPropagation(); 866 if (!action.hasClass('active')) { 867 actions.removeClass('active'); 868 action.addClass('active'); 869 } else { 870 actions.removeClass('active'); 871 } 872 }); 873 body.on('click', function (e) { 874 e.stopPropagation(); 875 }); 876 $('html, body').on('click', function () { 877 actions.removeClass('active'); 878 }); 879 }); 880 })(); 881 882 883 //////////////////////////////////////////////////// 884 // 21. Password Toggle Js 885 if($('.password-show-toggle').length > 0){ 886 887 var showBtn = $('.password-show-toggle'); 888 889 showBtn.each(function (e) { 890 $(this).on('click', function(x){ 891 let inputField = $(this).parent().find('input'); 892 if(inputField.attr('type') === "password"){ 893 inputField.attr('type', 'text') 894 $(this).children('.open-eye-icon').css({ 895 'display' : 'block' 896 }) 897 $(this).children('.close-eye-icon').css({ 898 'display' : 'none' 899 }) 900 }else{ 901 inputField.attr('type', 'password') 902 $(this).children('.open-eye-icon').css({ 903 'display' : 'none' 904 }) 905 $(this).children('.close-eye-icon').css({ 906 'display' : 'block' 907 }) 908 } 909 }) 910 }) 911 } 912 913 914 //////////////////////////////////////////////////// 915 // 22. Select 2 Js 916 if ($('.tpd-select2').length > 0) { 917 $(document).ready(function() { 918 $('.tpd-select2').select2({ 919 placeholder: 'Search Course Category. ex. Design, Development, Business', 920 allowClear: true, 921 tags: true 922 }); 923 }); 924 } 925 926 //////////////////////////////////////////////////// 927 // 23. Date and time js 928 flatpickr("input[name='datetime-local']", { 929 dateFormat: "Y-m-d" 930 }); 931 932 933 //////////////////////////////////////////////////// 934 // 24. Calernder js 935 if($('#calendar').length > 0){ 936 document.addEventListener('DOMContentLoaded', function() { 937 var calendarEl = document.getElementById('calendar'); 938 939 var calendar = new FullCalendar.Calendar(calendarEl, { 940 height: '600px', 941 expandRows: true, 942 slotMinTime: '08:00', 943 slotMaxTime: '20:00', 944 headerToolbar: { 945 left: 'prev,next', 946 center: 'title', 947 right: 'dayGridMonth,timeGridWeek,timeGridDay' 948 }, 949 initialView: 'dayGridMonth', 950 initialDate: new Date(), 951 navLinks: true, // can click day/week names to navigate views 952 editable: true, 953 selectable: true, 954 }); 955 956 calendar.render(); 957 }); 958 } 959 960 961 //////////////////////////////////////////////////// 962 // 25. chart js 963 if($('#chart').length > 0){ 964 965 var options = { 966 chart: { 967 type: 'line', 968 toolbar: { 969 show: false 970 } 971 }, 972 series: [{ 973 name: 'Profit', 974 data: [30,40,35,50,49,60,70,91,125], 975 color: '#556DF5' 976 }], 977 xaxis: { 978 categories: [1991,1992,1993,1994,1995,1996,1997, 1998,1999] 979 } 980 } 981 982 var chart = new ApexCharts(document.querySelector("#chart"), options); 983 984 chart.render(); 985 } 986 987 988 ///////////////////////////////////////////// 989 // 26. Scroll nav class add
990 if($('#course_details2_nav').length > 0){ 991 $(document).ready(function() { 992 $('#course_details2_nav').onePageNav(); 993 }); 994 } 995 996 //////////////////////////////////////// 997 // 27. Faq class add 998 document.querySelectorAll('.faq-expend').forEach(button => { 999 button.addEventListener('click', () => { 1000 const accordionItem = button.closest('.accordion-item'); 1001 1002 // Remove the 'expand' class from all accordion items 1003 document.querySelectorAll('.accordion-item').forEach(item => { 1004 item.classList.remove('expand'); 1005 }); 1006 1007 // Add the 'expand' class to the clicked accordion item 1008 accordionItem.classList.add('expand'); 1009 }); 1010 }); 1011 1012 1013 //////////////////////////////////////// 1014 // 28. Show more/ Show less js 1015 if($('.show-more-button').length > 0){ 1016 document.addEventListener('DOMContentLoaded', function () { 1017 const showMoreButton = document.querySelector('.show-more-button'); 1018 const content = document.querySelector('.content'); 1019 1020 showMoreButton.addEventListener('click', function () { 1021 const svgIcon = showMoreButton.querySelector('.svg-icon'); 1022 if (content.classList.contains('show')) { 1023 content.classList.remove('show'); 1024 showMoreButton.innerHTML = ''; 1025 svgIcon.innerHTML = ` 1026 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 1027 <path d="M6 1V11" stroke="#3C66F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> 1028 <path d="M1 6H11" stroke="#3C66F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> 1029 </svg> 1030 `; 1031 showMoreButton.appendChild(svgIcon); 1032 showMoreButton.append('Show more'); 1033 } else { 1034 content.classList.add('show'); 1035 showMoreButton.innerHTML = ''; 1036 svgIcon.innerHTML = ` 1037 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 1038 <path d="M1 6H11" stroke="#3C66F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> 1039 </svg> 1040 `; 1041 showMoreButton.appendChild(svgIcon); 1042 showMoreButton.append('Show less'); 1043 } 1044 }); 1045 }); 1046 } 1047 1048 1049})(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.