1jQuery(document).ready(function ($) { 2 console.log('Divi Child Custom JS Loaded'); 3 4 // Example: Add class on scroll 5 $(window).on('scroll', function () { 6 if ($(this).scrollTop() > 100) { 7 $('body').addClass('scrolled'); 8 } else { 9 $('body').removeClass('scrolled'); 10 } 11 }); 12}); 13 14jQuery(function ($) { 15 $('img, a').removeAttr('title'); 16 17 // For dynamically added elements 18 setInterval(function () { 19 $('img[title], a[title]').removeAttr('title'); 20 }, 500); 21}); 22 23jQuery(document).ready(function ($) { 24 25 function loadPosts(category = '', page = 1) { 26 27 const $container = $('#filtered-posts'); 28 29 // Reset animation 30 $container.removeClass('show').addClass('fade-up').hide(); 31 32 // Show loader 33 $('#posts-loader').fadeIn(); 34 35 $.post(ajax_obj.ajax_url, { 36 action: 'filter_posts', 37 category: category, 38 page: page 39 }, function (response) { 40 41 $container.html(response); 42 43 }).always(function () { 44 45 $('#posts-loader').fadeOut(function () { 46 47 // Show container first 48 $container.show(); 49 50 // Trigger fade-up (force reflow) 51 setTimeout(function () { 52 $container.addClass('show'); 53 }, 50); 54 55 }); 56 57 }); 58 } 59 60 // Initial load 61 loadPosts(); 62 63 // Filter click 64 $(document).on('click', '.post-filters button', function () { 65 $('.post-filters button').removeClass('active'); 66 $(this).addClass('active'); 67 68 loadPosts($(this).data('category'), 1); 69 }); 70 71 // Pagination click 72 $(document).on('click', '.custom-pagination a', function (e) { 73 e.preventDefault(); 74 75 loadPosts( 76 $('.post-filters button.active').data('category'), 77 $(this).data('page') 78 ); 79 }); 80 81}); 82 83 84jQuery(document).ready(function ($) { 85 86 if (!$('#mobile-menu-overlay').length) { 87 $('body').append('<div id="mobile-menu-overlay"></div>'); 88 } 89 90 var $menu = $('#et_mobile_nav_container');
91 var $overlay = $('#mobile-menu-overlay'); 92 93 $('#custom-hamburger').on('click', function () { 94 $menu.addClass('menu-open'); 95 $overlay.fadeIn(200); 96 $('body').addClass('menu-active'); 97 }); 98 99 $('#menu-close-icon').on('click', function () { 100 $menu.removeClass('menu-open'); 101 $overlay.fadeOut(200); 102 $('body').removeClass('menu-active'); 103 }); 104 105 $overlay.on('click', function () { 106 $menu.removeClass('menu-open'); 107 $overlay.fadeOut(200); 108 $('body').removeClass('menu-active'); 109 }); 110}); 111 112
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.