링크를 클릭할 때 새창 띄우기
자바스크립트 이용
〈a href="javascript:void(window.open('주소','팝업이름','width=가로,height=세로'))"〉Link〈/a〉
온클릭 이용
〈a href="#" onClick="window.open('주소','팝업이름','width=가로,height=세로');return false"〉Link〈/a〉
버튼을 클릭할 때 새창 띄우기
〈input type="button" value="JSGUIDE" onClick="window.open('주소','팝업이름','width=가로,height=세로')"〉
페이지 로딩이 완료되면 새창 띄우기
〈BODY onLoad="window.open('주소','팝업이름','width=가로,height=세로')"〉
무조건 새창 띄우기
〈script langauge="javascript"〉
window.open("주소","팝업이름","width=가로,height=세로");
〈/script〉
몇 초 후에 새창 띄우기
〈script langauge="javascript"〉
setTimeout("window.open('주소','팝업이름','width=가로,height=세로')",5000); //1000 = 1초
〈/script〉
창닫기
<a href = "javascript:self.close();">
'공부자료 > 자바스크립트' 카테고리의 다른 글
버튼에 이미지 넣기 (0) | 2013.08.31 |
---|
댓글