js ... 좀 봐주시면 좋겠어요 ㅠ

js ... 좀 봐주시면 좋겠어요 ㅠ

QA

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 ' (숫자는 임의값)

.. 저도 디자이너라고 말하기 부끄러울 정도로 .. -ㅅ - 힘들게 작업하고 있어여 ㅋㅋ
뭐.. 디자이너라기보다 여기저기서 본거 짜집기-_ - ..
웹짜집퍼정도로 분류될 것 같네여 ㅠ ㅠ 디자인이고, 코딩이고...

답변을 작성하시기 전에 로그인 해주세요.
전체 298
QA 내용 검색
filter #js ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT