$(document).ready(function(){ // ù ¹øÂ° ¹öư & ù ¹øÂ° ÄÜÅÙÃ÷ ÀÚµ¿ Ȱ¼ºÈ­ $('.year-btn').first().addClass('active'); $('.history-content').first().addClass('active'); // Ŭ¸¯ À̺¥Æ® $('.year-btn').click(function(){ var target = $(this).data('target'); $('.year-btn').removeClass('active'); $(this).addClass('active'); $('.history-content').removeClass('active'); $('#' + target).addClass('active'); $('html, body').animate({ scrollTop: $('.history-content-area').offset().top - 100 }, 400); }); }); $(document).ready(function () { var current_url = window.location.href; $('.sub_category_tab ul li a').each(function () { if (current_url.indexOf(this.href) !== -1) { $(this).addClass('active'); } }); });