팝업창 리사이즈
일/Jquery 2016. 6. 28. 10:34
최종 적으로 브라우저의 outerWidth / outerHeight 지원 여부를 확인하면 모든 브라우저에서
팝업창의 크기를 변경할 수 있습니다.
$(window).load(function() {
var strWidth;
var strHeight;
//innerWidth / innerHeight / outerWidth / outerHeight 지원 브라우저
if ( window.innerWidth && window.innerHeight && window.outerWidth && window.outerHeight ) {
strWidth = $('#container').outerWidth() + (window.outerWidth - window.innerWidth);
strHeight = $('#container').outerHeight() + (window.outerHeight - window.innerHeight);
}
else {
var strDocumentWidth = $(document).outerWidth();
var strDocumentHeight = $(document).outerHeight();
window.resizeTo ( strDocumentWidth, strDocumentHeight );
var strMenuWidth = strDocumentWidth - $(window).width();
var strMenuHeight = strDocumentHeight - $(window).height();
strWidth = $('#container').outerWidth() + strMenuWidth;
strHeight = $('#container').outerHeight() + strMenuHeight;
}
//resize
window.resizeTo( strWidth, strHeight );
});