D

배너를 클릭하면 새로운 창이 뜨게 하려면 ?

<SCRIPT language="javascript" type="text/javascript">
//<![CDATA[
var imgArrUrl = [
["./banner/top.gif", "http://www.ecohaus.co.kr"]
];
var idx = 0;

function change(flag) {
var obj = document.getElementById("view");
if(flag == "-"){
if(idx == 0) idx = imgArrUrl.length-1;
else idx--;
}else if(flag == "+"){
if(idx == imgArrUrl.length-1) idx = 0;
else idx++;
}
obj.src = imgArrUrl[idx][0];
obj.onclick=null;
obj.onclick = function() {
location = imgArrUrl[idx][1];
}
}

setInterval(function(){
change('+');
}, 5000);
//]]>
</SCRIPT>

<center>
<div class="main-banner-big">
<div class="inner">
<table align="center" cellspacing="0" valign="top" cellpadding="0" border="0">
<tr>
<td valign="top" align="center">
<img src="./banner/top.gif" id="view" style="cursor:pointer" onclick="location='http://www.ecohaus.co.kr/'">
</td>
</tr>
</table>
</div>
</div>
</center>
배너를 띄우는 소스 인데요..
이미지를 누르면 원래 있던 창에 나타납니다.

이걸 이미지를 클릭하면 새로운창에 뜨게 하고 싶은데....
어딜 고쳐야 하나요 ?
|

댓글 3개

<img src="./banner/top.gif" id="view" style="cursor:pointer" onclick="location='http://www.ecohaus.co.kr/'">

-->

<img src="./banner/top.gif" id="view" style="cursor:pointer" onclick="window.open('http://www.ecohaus.co.kr/', '', '');">
잘 되네요... 감사합니다.
onClick="window.open('http://사이트주소','_blank','height=새창높이,width=새창넓이,top=창이열리는세로좌표값,left=창이열리는가로 좌표값')"
요렇게 바꾸세요.

예를 들면

onClick="window.open('http://사이트주소','_blank','height=700,width=1000,top=0,left=0')"

테스트는 안해봤움요ㅜㅜ
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13년 전 조회 1,019
13년 전 조회 712
13년 전 조회 2,117
13년 전 조회 741
13년 전 조회 1,672
13년 전 조회 808
13년 전 조회 922
13년 전 조회 972
13년 전 조회 1,602
13년 전 조회 1,624
13년 전 조회 1,289
13년 전 조회 863
13년 전 조회 1만
13년 전 조회 963
13년 전 조회 1,333
13년 전 조회 970
13년 전 조회 750
13년 전 조회 1,033
13년 전 조회 1,650
13년 전 조회 948
🐛 버그신고