본문 바로가기

먹고살거/웹지식[IT정보]

팀교육 : 접근성을 해치지 않는 팝업 열기

HTML
 <a href="#" onclick="openPopup('popup_print', this.href, '20','20','740','650','0','0','0','1','0'); return false;">새 창</a>

JS

function openPopup(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) {
 var objPopup;
 toolbar_str  =  toolbar  ? 'yes' : 'no'; 
 menubar_str  =  menubar  ? 'yes' : 'no'; 
 statusbar_str =  statusbar   ? 'yes' : 'no'; 
 scrollbar_str =  scrollbar   ? 'yes' : 'no'; 
 resizable_str =  resizable   ? 'yes' : 'no';  
 objPopup = window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
 return objPopup;
}


 
JS버젼
jquery-1.4.2.min.js