// 桌面端窗口自适应 window.onresize = () => { if ($(window).width() >= 768) { $('.button-group button.active').click(); } }; // 笔记分类 let $grid_note = $('.note-list').isotope({ itemSelector: '.note-grid', }); $('.note-menu').on('click', 'button', function () { $(this).addClass('active').siblings().removeClass('active'); let filterValue = $(this).attr('data-filter'); $grid_note.isotope({ filter: filterValue, }); }); // API分类 let $grid_api = $('.api-list').isotope({ itemSelector: '.api-grid', }); $('.api-menu').on('click', 'button', function () { $(this).addClass('active').siblings().removeClass('active'); let filterValue = $(this).attr('data-filter'); $grid_api.isotope({ filter: filterValue, }); });