$(document).ready(function() {
//토글 함수
function toggleHandle() {
$('.quick_menu').toggleClass('type_fold');
}
//체크 localStorage 데이터 겟
if (localStorage.getItem('switch-state') && localStorage.getItem('switch-state') === 'true') {
toggleHandle();
}
//클릭시 토글 처리 localStorage 셋팅 처리
$('.btn_fold').click(function() {
let el = $('.quick_menu');
toggleHandle();
localStorage.setItem('switch-state', el.hasClass('type_fold'));
});
});
퀵메뉴에 type_fold 추가시 닫힘 제거시 열림
댓글