트렌드나인

셀렉트 박스 이뿌게 꾸미기

<script>
//insert_select(저장변수명,가로,폰트크기,보드색,배경색,선택색,화살표이미지);
//insert_select_option(저장변수명,폰트크기,보드색,배경색,선택색,value,view_value);

//기본셀릭트만들기
insert_select("test","100","8","F6D8B0","FFFFFF","F6D8B0","./images/menu_02/btn_select.gif");

//셀렉트 옵션추가
insert_select_option("test","8","F6D8B0","FFFFFF","F6D8B0","1","1");
insert_select_option("test","8","F6D8B0","FFFFFF","F6D8B0","2","2");
insert_select_option("test","8","F6D8B0","FFFFFF","F6D8B0","3","3","Y");
</script>

================================= js부분
//처리부분 js로 저장해서 사용하세요..^^
var zindex = 10000;

function insert_select ( sn,w,f,b,g,c,img) {
  select_count = new Array();
  select_count[sn] = 0;
  zindex--;
  document.write("    <div >");
  document.write("    <table border='0' cellspacing='1' cellpadding='1' width='"+w+"'  style='table-layout:fixed;width:"+w+";' bgcolor='"+b+"' onclick='select_click(\""+sn+"\");' >");

  document.write("    <tr>");
  document.write("        <td bgcolor='"+g+"'>");
  document.write("            <input type='text' id='"+sn+"' name='"+sn+"' style='border:none;cursor:hand;width:100%;font-size:"+f+"pt;' onselectstart=\"return false\" readonly> ");

  document.write("        </td>");
  if(img != "") {
      document.write("    <td width=18 bgcolor='"+g+"' align=center valign=bottom style='cursor:hand'><img src='"+img+"'></td>");        
  } else {
      document.write("    <td width=18 bgcolor='"+g+"' align=center valign=bottom style='cursor:hand'>v</td>");
  }
  document.write("    </tr>");
  document.write("    </table>");
  document.write("    </div>");
  document.write("<div id='"+sn+"_select_div' name='"+sn+"_select_div'  style='display:none;z-index:"+zindex+";position:absolute;'  onmouseover='"+sn+"_select_div.style.display=\"\";' onmouseout='"+sn+"_select_div.style.display=\"none\";'>");
 
  document.write("        <table border='0' cellspacing='1' cellpadding='1' bgcolor='"+b+"' width="+w+" onmouseover='"+sn+"_select_div.style.display=\"\";'>");
 
  document.write("        <tr><td bgcolor='"+g+"' style='line-height:1.3em;' id='"+sn+"_select_span'></td></tr>");
 
  document.write("        </table>");
  document.write("    </div>");
}

function insert_select_option(sn,f,b,g,c,v,vv,chk)     {
  select_count[sn] ++;    
  option_html = "<span style='width:100%;font-size:"+f+"pt' onclick='"+sn+".value=\""+v+"\";"+sn+"_select_div.style.display=\"none\";' onmouseover='this.style.background=\""+c+"\"' onmouseout='this.style.background=\""+g+"\"'>"+vv+"/"+select_count[sn] +"</span><br>";

  if(select_count[sn] == 1 || chk == "Y" ) {
      document.getElementById( sn ).value = v
  }
  document.getElementById( sn+"_select_span").innerHTML += option_html;
}

function  select_click(sn)     {    
  if ( document.getElementById( sn+"_select_div").style.display == "none") {
      document.getElementById( sn+"_select_div").style.display = "";
  } else {
      document.getElementById( sn+"_select_div").style.display = "none";
  }
}
[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
18년 전 조회 2,553
18년 전 조회 5,748
18년 전 조회 5,083
18년 전 조회 4,087
18년 전 조회 3,756
18년 전 조회 2,454
18년 전 조회 2,455
18년 전 조회 3,965
18년 전 조회 2,576
18년 전 조회 2,818
18년 전 조회 2,068
18년 전 조회 4,771
18년 전 조회 2,470
18년 전 조회 2,614
18년 전 조회 4,338
18년 전 조회 4,228
18년 전 조회 2,445
18년 전 조회 3,091
18년 전 조회 5,479
18년 전 조회 2,723
18년 전 조회 3,282
18년 전 조회 8,823
18년 전 조회 2,330
18년 전 조회 3,242
18년 전 조회 2,929
18년 전 조회 3,248
18년 전 조회 2,676
18년 전 조회 2,767
18년 전 조회 3,049
18년 전 조회 4,292
18년 전 조회 2,959
18년 전 조회 3,062
18년 전 조회 3,531
18년 전 조회 3,237
18년 전 조회 2,442
18년 전 조회 2,859
18년 전 조회 2,858
18년 전 조회 4,356
18년 전 조회 5,089
18년 전 조회 2,635
18년 전 조회 2,821
18년 전 조회 2,754
18년 전 조회 4,064
19년 전 조회 2,722
19년 전 조회 2,706
19년 전 조회 2,039
19년 전 조회 2,327
19년 전 조회 3,025
19년 전 조회 3,908
19년 전 조회 3,430
19년 전 조회 3,306
19년 전 조회 2,351
19년 전 조회 4,450
19년 전 조회 2,475
19년 전 조회 4,514
19년 전 조회 2,851
19년 전 조회 2,695
19년 전 조회 3,802
19년 전 조회 2,557
19년 전 조회 2,489
19년 전 조회 3,609
19년 전 조회 4,265
19년 전 조회 2,511
19년 전 조회 2,667
19년 전 조회 4,162
19년 전 조회 3,043
19년 전 조회 3,676
19년 전 조회 3,100
19년 전 조회 1,996
19년 전 조회 2,444
19년 전 조회 4,007
19년 전 조회 3,251
19년 전 조회 3,315
19년 전 조회 3,925
19년 전 조회 2,488
19년 전 조회 2,584
19년 전 조회 3,510
19년 전 조회 2,183
19년 전 조회 2,562
19년 전 조회 2,846
19년 전 조회 2,098
19년 전 조회 2,431
19년 전 조회 2,311
19년 전 조회 2,838
19년 전 조회 2,261
19년 전 조회 2,055
19년 전 조회 2,090
19년 전 조회 2,067
19년 전 조회 3,085
19년 전 조회 1,871
19년 전 조회 5,979
19년 전 조회 2,724
19년 전 조회 1,996
19년 전 조회 5,034
19년 전 조회 2,373
19년 전 조회 5,171
19년 전 조회 3,540
19년 전 조회 2,461
19년 전 조회 2,134
19년 전 조회 2,461