소스 파일 : /view/view_contents.js (2020-12-09)     소스 설명 : (용어보기) 용어해설 보기에서, 내용 javascript (페이지 기잔 항목 목차)
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
// (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();
    			}
	    	);
});



Copyrightⓒ written by 차재복 (Cha Jae Bok)               기술용어해설 후원
"본 웹사이트 내 모든 저작물은 원출처를 밝히는 한 자유롭게 사용(상업화포함) 가능합니다"