2015. 9. 15. 14:58 IT/jquery_javascript
레이어 팝업 가운데 정렬
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
$(document).ready(function() {
$.fn.center = function () {
this.css("position","absolute");
this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px");
this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
return this;
}
$("body").append("<div id='payIngPopup'></div>");
$("#popLayer").show();
$("#popLayer").center();
});
<div id="popLayer" style="display:none;z-index: 9999;">
'IT > jquery_javascript' 카테고리의 다른 글
저장 버튼 더블 클릭, 중복 클릭 방지 (1) | 2015.10.28 |
---|---|
크로스 브라우징시 브라우저 지원되는 객체 식별하여 id 값 가져오는함수 (0) | 2015.10.16 |
jquery 숫자만 입력 (0) | 2015.07.17 |
버튼 더블 클릭 막기. (0) | 2015.05.06 |
jquery parent, parents. 상위 요소 가져오기. (0) | 2015.04.21 |