묻고답하기
자바스크립트 메뉴 새창띄우는법 문의
2010.10.18 19:40
<html>
<head>
<title>HTTP://YAJAVA.COM</title>
<META NAME="Author" CONTENT="YAJAVA">
<META NAME="Keywords" CONTENT="java script, script, java , applet , cgi, php, tip ,icon">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
font{ font-family:"굴림"; font-size: 9pt; line-height:17px; }
td{ font-family:"굴림"; font-size: 9pt; line-height:17px; }
a:visited {color:#000000; text-decoration: none }
a:link { color:#000000; text-decoration: none; }
a:active { color:#00ff00; text-decoration: none; }
a:hover { color:#FFA217; text-decoration: underline; }
p,br,body,td,select,input,form,textarea,option {font-size:9pt;font-family:돋움;}
.cont{line-height:140%}
.f111 {
font-size:11px;
letter-spacing: -1px;
}
.blue_b {color:#5187D7;font-weight:bold;}
BODY
{scrollbar-face-color: #ffffff;
scrollbar-shadow-color: #c0c0c0;
scrollbar-highlight-color: #c0c0c0;
scrollbar-3dlight-color: #ffffff;
scrollbar-darkshadow-color:#ffffff;
scrollbar-track-color: #ffffff;
scrollbar-arrow-color: #ffffff}
img {border:0 none;}
form{margin:0}
input {color:black; font-size: 9pt; background-color:#ffffff; border:1 solid #808080;size= 30;height:20px}
textarea {color:black; font-size: 9pt; background-color:white; border:1 solid #808080}
.style1 {color: #FFFFFF}
.menu {
border: solid 1px #BFBFBF;
padding:10px 10px 15px 10px;
background-color:white;
}
.menuItem {
padding:4px 10px 4px 10px;
border-bottom:solid 1px #dddddd;
}
.menuItem:hover {
background-color:#f1f1f1;
}
.menuItem a {
color:#666666;
text-decoration:none;
}
#demo {
background-color:#eeeeee;
cursor:pointer;
padding:5px 20px 5px 20px;
margin: 30px 0;
width: 425px;
}
#demo span {
padding:3px 20px 0px 20px;
cursor:pointer;
}
#demo span:hover {
text-decoration:underline;
}
</style>
<script type="text/javascript" src="/sclmenu.js"></script>
<script language="JavaScript" type="text/JavaScript">
(function(){
var menu1=new Scl.Menu(130);
menu1.addItem('Google Search','http://www.google.com'); // 이주소를 새창으로 띄우고 싶습니다.
menu1.addItem('+
'+
'Yahoo Search','http://www.yahoo.com');
menu1.addItem('+
'MSN Live Search','http://www.live.com');
menu1.addItem('Ask Search','http://www.ask.com');
menu1.dockTo('demo1');
var menu2=new Scl.Menu(130);
menu2.addItem('CNN News','http://www.cnn.com');
menu2.addItem('Fox News','http://www.foxnews.com');
menu2.addItem('BBC News','http://news.bbc.co.uk');
menu2.addItem('+
'abc News'+
','http://abcnews.go.com');
menu2.addItem('Google News'+
','http://news.google.com');
menu2.dockTo('demo2');
var menu3=new Scl.Menu();
menu3.bottomToTop=true;
menu3.addItem('Google Search','http://www.google.com');
menu3.addItem('Yahoo Search','http://www.yahoo.com');
menu3.addItem('MSN Live Search','http://www.live.com');
menu3.addItem('Ask Search','http://www.ask.com');
menu3.dockTo('demo3');
}
)();
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="606" border="1" cellpadding="0" cellspacing="0" align="center" bordercolor="#000000">
<tr>
<td width="602" height="25" valign="middle" align="center" bgcolor="#006699"><span class="style1">심플 드롭다운 메뉴 </span></td>
</tr>
<tr>
<td height="183" valign="middle" style="padding:10px 10px 10px 10px;"><p><div id="demo">
<span id="demo1">Yajava Menu1</span>
<span id="demo2">Yajava Menu2</span>
<span id="demo3">Yajava Menu3</span>
</div>
</p></td>
</tr>
<tr>
<td height="359" valign="top"><p> </p>
<p><font color="#FF0000"><!--1. 아래 스크립트를 HEAD 부분에 복사해 넣으세요. --></font></p>
<p><style type="text/css"></p>
<p>.menu {<br>
border: solid 1px #BFBFBF;<br>
padding:10px 10px 15px 10px;<br>
background-color:white;<br>
}</p>
<p>.menuItem {<br>
padding:4px 10px 4px 10px;<br>
border-bottom:solid 1px #dddddd;<br>
}</p>
<p>.menuItem:hover {<br>
background-color:#f1f1f1;<br>
}</p>
<p>.menuItem a {<br>
color:#666666;<br>
text-decoration:none;<br>
}</p>
<p>#demo {<br>
background-color:#eeeeee;<br>
cursor:pointer;<br>
padding:5px 20px 5px 20px;<br>
margin: 30px 0;<br>
width: 425px;<br>
}</p>
<p>#demo span {<br>
padding:3px 20px 0px 20px;<br>
cursor:pointer;<br>
}</p>
<p>#demo span:hover {<br>
text-decoration:underline;<br>
}<br>
</p>
<p></style></p>
<p> </p>
<p><script type="text/javascript" src=""sclmenu.js"></script></p>
<p><script language="JavaScript" type="text/JavaScript"></p>
<p>(function(){</p>
<p>var menu1=new Scl.Menu(130);<br>
menu1.addItem('Google Search','http://www.google.com');<br>
menu1.addItem('Yahoo Search','http://www.yahoo.com');<br>
menu1.addItem('MSN Live Search','http://www.live.com');<br>
menu1.addItem('Ask Search','http://www.ask.com');<br>
menu1.dockTo('demo1');</p>
<p>var menu2=new Scl.Menu(130);<br>
menu2.addItem('CNN News','http://www.cnn.com');<br>
menu2.addItem('Fox News','http://www.foxnews.com');<br>
menu2.addItem('BBC News','http://news.bbc.co.uk');<br>
menu2.addItem('abc News','http://abcnews.go.com');<br>
menu2.addItem('Google News','http://news.google.com');<br>
menu2.dockTo('demo2');</p>
<p>var menu3=new Scl.Menu();<br>
menu3.bottomToTop=true;<br>
menu3.addItem('Google Search','http://www.google.com');<br>
menu3.addItem('Yahoo Search','+
'http://www.yahoo.com');<br>
menu3.addItem('MSN Live Search','http://www.live.com');<br>
menu3.addItem('Ask Search','+
'http://www.ask.com');<br>
menu3.dockTo('demo3');<br>
}<br>
)();<br>
</script></p>
<p> </p>
<p><br>
<font color="#FF0000"><!--<BODY></BODY> 부분에 아래의 스크립트를 복사해
넣으세요--></font></p>
<p><div id="demo"><br>
<span id="demo1">Yajava Menu1</span><br>
<span id="demo2">Yajava Menu2</span><br>
<span id="demo3">Yajava Menu3</span><br>
</div></p>
<p> </p>
<p> </p></tr>
</table>
</body>
</html>
// 빨간색 표시된 부분이 해당 주소 URL인테 _black 지정해서 새창으로 띄우는법이 어떻게 될까요?
//고수님의 답변 부탁드립니다.
참고로 sclmenu.js 파일 원하시면 알려드릴께요~
</script>댓글 1
-
hhgyu
2010.10.18 20:19
-
해피나라
2010.10.18 21:09
먼저 답변 감사드립니다. 위 내용으로하니 정상적으로 처리가 되는데요..그런데 창이 2개가 동시에 뜹니다. 1개만 뜨면 되는데요..무슨문제인지요?
menu1.addItem('Google Search','http://www.google.com');<br>
이것을
menu1.addItem('Google Search','javascript:full("http://www.google.com")');<br>
이런식으로 해주시면 되요
그리고
menu3.bottomToTop=true;
이거는 버튼이 위로 열립니다~