$(function(){ /* scroll */ var $animation_elements = $('.ani'); var $window = $(window); function check_if_in_view() { var window_height = $window.height(); var window_top_position = $window.scrollTop(); var window_bottom_position = (window_top_position + window_height); $.each($animation_elements, function() { var $element = $(this); var element_height = $element.outerHeight(); var element_top_position = $element.offset().top+200; var element_bottom_position = (element_top_position + element_height); //console.log(element_top_position); //check to see if this current container is within viewport if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) { $element.addClass('in-view'); } else { //$element.removeClass('in-view'); } }); } $window.on('scroll resize', check_if_in_view); $window.trigger('scroll'); //셀렉트박스 $('.select_layout').find('.select_title').on('click', function(){ $(this).parent().toggleClass('on'); $(this).parent().find('.list').stop().slideToggle(300); }); $('.select_layout').find('li').on('click', function(){ var hidden = $(this).data('option'), titleName = $(this).text(); $(this).parent().parent().find('.select_hidden').val(hidden); $(this).parent().parent().find('.select_title').text(titleName); //셀렉트박스 자동 닫기 $(this).parent().parent().removeClass('on'); $(this).parent().hide(); }); $(".m21 table .name button.onpop").on("click",function(){ var num = $(this).data("num"); //console.log(num); $(".pop").fadeIn(300); $(".dim").fadeIn(300); $.ajax({ type : "POST" //"POST", "GET" , async : true //true, false , url : "/_pop_list.php" , dataType : "html" //전송받을 데이터의 타입 , data: { data_num : num } , timeout : 3000 //제한시간 지정 , cache : false //true, false , contentType: "application/x-www-form-urlencoded; charset=UTF-8" , error : function(request, status, error) { //통신 에러 발생시 처리 } , success : function(response, status, request) { //통신 성공시 처리 if(true){ $(".pop .conwrap").html(response); }else{ } } , beforeSend: function() { //통신을 시작할때 처리 } , complete: function() { //통신이 완료된 후 처리 } }); }); $(".btn_x").click(function(){ $(".pop").fadeOut(300); $(".dim").fadeOut(300); }); $(".dim").click(function(){ $(".pop").fadeOut(300); $(".dim").fadeOut(300); }); });