Menu

콤보메뉴 만들기

2016. 6. 3. 11:07

안개핑 Html & Css

 

 


 

.<HTML>
<HEAD><title>콤보메뉴 만들기</title><style>

</style></HEAD>
<p><center><table width="100%" height="30%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>
<td align="center" valign="middle">
 <font face="Verdana"><span style="font-size:9pt;"><SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var no_options;

document.write('<table cellspacing="5" cellpadding="5" style="border:2 solid #808080" align="center"><tr><td>');
document.write('<form name="qiksearch">');
if(navigator.appName=="Microsoft Internet Explorer")
{
 document.write('<font face="verdana,arial,helvetica" size="-1" color="#000000">바로가기 링크 갯수 <select name="select_items" onchange="javascript:showItems(this.document.qiksearch.select_items.value)" style="font-size:8pt">');
 for(var i=1; i<=30; i++)
 {
  document.write('<option value="' + i + '">' + i + '</option>');
 }
 this.document.qiksearch.select_items.selectedIndex = 4;
 document.write('</select> links.<br><br>');
}

document.write('<b>Combo Box  문구 :</b><br><br>');
document.write('<input type="text" value="Select me" name="combo_caption" size="30" style="height:20; border:1 solid #000000">');
document.write('<br><br><b>Combo Items :</b><br><br>');
document.write('<div id="items">');
for(var i=1; i<=5; i++)
{
 document.write('Option : <input type="text" size="12" name="option' + i + '" style="height:20; border:1 solid #000000"> Link to : <input type="file" name="linkto' + i + '" size="15" style="height:20; border:1 solid #000000"><br>');
}
document.write('</div>');
document.write('<br><br><center><input type="button" name="qiksearch_submit" value="코드 생성" onclick="display()" style="font-family:verdana,arial,helvetica; font-size:8pt; height:20; width:48%; background:#EFEFEF; border:1 solid #808080; cursor:hand"> <input type="reset" onclick="javascript:location.reload();" style="font-family:verdana,arial,helvetica; font-size:8pt; height:20; width:48%; background:#EFEFEF; border:1 solid #808080; cursor:hand"></center>');
document.write('<br></td></tr></table>');

function showItems(n)
{
 var item_disp = "";
 for(var i=0; i<n; i++)
 {
  item_disp += 'Option : <input type="text" size="12" name="option' + (i+1) + '" style="height:20; border:1 solid #000000"> Link to : <input type="file" name="linkto' + (i+1) + '" size="15" style="height:20; border:1 solid #000000"><br>';
 }
 no_options=n;
 this.document.all.items.innerHTML = item_disp;
}

if(navigator.appName=="Microsoft Internet Explorer")
{
 no_options = this.document.qiksearch.select_items.value;
}
else
{
 no_options = 5;
}

function display() {
   DispWin=window.open('','NewWin',
   'toolbar=no,status=no,width=500,height=375')
   message="<font face=arial,verdana,helvetica size=-2 color=#000000><b>";
   message += "<br>&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;";
   message += "<br>function go()";
   message += "<br>{";
   message += "<br>&nbsp;if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != &quot;none&quot;)";
   message += "<br>&nbsp;{";
   message += "<br>&nbsp;&nbsp;location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value";
   message += "<br>&nbsp;}";
   message += "<br>}";
   message += "<br>&lt;/script&gt;";
   message += "<br>";
   message += "<br>&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;";
   message += "<br>document.write('&lt;form name=&quot;selecter&quot;&gt;&lt;select name=&quot;select1&quot;&gt;');";
   message += "<br>document.write('&lt;option value=none&gt;" + this.document.qiksearch.combo_caption.value + "&lt;/option&gt;');";
   message += "<br>document.write('&lt;option value=none&gt;--------------------&lt;/option&gt;');";
    for(var i=1; i<=no_options; i++)
    {
     message += "<br>document.write('&lt;option value=&quot;" + eval('this.document.qiksearch.linkto' + i + '.value') + "&quot;&gt;" + eval('this.document.qiksearch.option' + i + '.value') + "&lt;/option&gt;');";
    }
   message += "<br>document.write('&lt;/select&gt;');";
   message += "<br>document.write('&lt;input type=&quot;button&quot; value=&quot;Go&quot; onclick=&quot;go()&quot;&gt;');";
   message += "<br>document.write('&lt;/form&gt;');";
   message += "<br>&lt;/script&gt;";
   DispWin.document.write(message);
}

//  End -->
</script>
                </span></font></td></tr></table>
  <center><SCRIPT LANGUAGE="JavaScript">
<!--
function sourceopen() {
var This_URL = "";
This_URL = document.location;
window.location = "view-source:"+This_URL;
}
-->
</SCRIPT>
    <p><INPUT TYPE=button NAME="source" value="소스보기" onClick="sourceopen()" style="color:rgb(255,0,102); background-
    </body></html>


 

'Html & Css' 카테고리의 다른 글

콤보메뉴 마법사  (0) 2016.06.03
깔끔한 테이블시계  (0) 2016.06.03
한번에 폰트크기 지정하기  (1) 2016.06.03
칼라 셀렉트 폼  (0) 2016.06.03
기대수명 계산기  (1486) 2016.06.03