// (2020.12.09, 차재복, Cha Jae Bok, cjbword@gmailcom)
$( function () {
// 페이지 기반으로 항목 목차를 보여줌
$(document).on("click", ".ajax_page",
function(event){
event.preventDefault();
$(this).css('font-weight','bold');
$(this).prev('a').css('font-weight','normal');
var mid = $(this).attr('href') ;
$.ajax ({
type : 'POST', // GET/POST 구분, 기본값은 GET
url : 'view_contents_ajax.php',
data : { id : mid },
success : function(result){
$('#contents').html(result);
},
error : function(request, status, error ) {
console.log ("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
);
// 클릭하면 조건에 따라 해당 하위 요소를 숨기거나 나타나게 함
$(document).on('click','.lower_ol_hideshow',
function(event) {
if ( $(this).text() == '▽' ) {
// $(this).next('ol').hide();
$(this).siblings('ol').hide();
$(this).siblings('span').hide();
// $('#items').hide();
$(this).text('▷');
} else if ( $(this).text() == '▷' ) {
// $(this).next('ol').show();
$(this).siblings('ol').show();
$(this).siblings('span').show();
// $('#items').show();
$(this).text('▽');
}
event.preventDefault();
}
);
});