js ... 좀 봐주시면 좋겠어요 ㅠ
본문
제가 문법을 몰라가지고요;; ㅎ (맨날 공부한다고 하고 이러고 있네여~)
<script type="text/javascript">
function openwin() {
// 表示するウィンドウのサイズ
var w_size=1000;
var h_size=800;
// 表示するウィンドウの位置
var l_position=Number((window.screen.width-w_size)/2);
var t_position=Number((window.screen.height-h_size)/2);
window.open('./print.html', 'new', 'width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position);
}
</script>
위 코드를 어디서 보고 갖다 붙였는데...
window.open('./print.html', 'new', 'width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position);
위에 부분 이상하지 않아여?? ' <<< 이놈이 이상하게 된 것 같은데;;;
window.open('./print.html', 'new', width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position');
요게 맞나요???
그리고 스크롤을 넣으려면 ...
window.open('./print.html', 'new', width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position', scrollbars='yes');
이렇게 넣는 것이 맞을까요???
잘 부탁드립니다 ㅠ
!-->!-->!-->!-->
답변 1
http://it79.egloos.com/v/315528
설명할려니 길니깐 ^^ 이거 보고 확인해보세요.
window.open('./print.html', 'new', 'width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position);
이게 맞는겁니다.
open() 함수의 3번째 인자는 string 형태로 들어가야 합니다,
'width='+w_size+', height='+h_size+', left='+l_position+', top='+t_position 는 아래와 같습니다.
'width=1000, height=300, left=100, left, 100, top=100 ' (숫자는 임의값)
!-->
답변을 작성하시기 전에 로그인 해주세요.