게시판에서 링크 클릭시 새창으로 뜨게하려고 하는데요
게시판안에 글을 쓰고.. 링크 클릭시 원하는 사이즈의 새창으로 열고 싶은데요..
이런 스크립트는 붙여넣고 나면.. 스크립트 에러가 나서..
확인해보면 아래 부분이.. 사라지고 없는데..
--------------------------------
<script language="JavaScript">
<!--
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
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';
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);
}
// -->
</script>
-------------------------------------
원하는 사이즈의 새창을 열려면 어떻게 넣어줘야 하나요..?
아니면.. 저 스크립트를 다른곳에 넣어야 하는건지...
댓글 2개
/js/common.js 파일을 보시면 아래 함수가 있습니다.
// 새 창
function popup_window(url, winname, opt)
{
window.open(url, winname, opt);
}
//
<a href="#" onclick="javascript:popup_window('주소','윈도우이름','창크기및 설정');">새창띄위기</a>
창크기 및 설정은 scrollbars=yes,width=417,height=385,top=10,left=20 이렇게 넣으면 될것 같아요.