<div class="codetitle"> <span><a style="CURSOR: pointer" data="51974" class="copybut" id="copybut51974" onclick="doCopy('code51974')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code51974"> <br><style> <BR>.uboxstyle{width:174px;height:39px; float:right;} <BR>#uboxstyle{width:174px;height:39px; float:right;} <BR>#uboxstyle .select_box{width:174px;height:39px; float:left;} <BR>#uboxstyle div.tag_select{display:block;color:#79A2BD;width:174px;height:39px;background:transparent url("images/select01.jpg") no-repeat 0 0;padding:0 10px;line-height:39px;} <BR>#uboxstyle div.tag_select_hover{display:block;color:#79A2BD;width:174px;height:39px;background:transparent url("images/select01.jpg") no-repeat 0 0;padding:0 10px;line-height:39px; } <BR>#uboxstyle div.tag_select_open{display:block;color:#79A2BD;width:174px;height:39px;background:transparent url("images/select01.jpg") no-repeat 0 0px;padding:0 10px;line-height:39px;} <BR>#uboxstyle ul.tag_options{padding:0;margin:0;list-style:none;width:174px;padding:0 0 5px;margin:0;} <BR>#uboxstyle ul.tag_options li{display:block;width:174px;padding:0 10px;height:30px;text-decoration:none;line-height:30px;color:#79A2BD;text-align:left;} <BR>#uboxstyle ul.tag_options li.open_hover{color:#000} <BR>#uboxstyle ul.tag_options li.open_selected{color:#000} <BR></style> <br><script language="JavaScript"> <BR>var selects = document.getElementsByTagName('select'); <BR>var isIE = (document.all && window.ActiveXObject && !window.opera) ? true : false; <BR>function $(id) { <BR>return document.getElementById(id); <BR>} <BR>function stopBubbling (ev) { <BR>ev.stopPropagation(); <BR>} <BR>function rSelects() { <BR>for (i=0;i<selects.length;i++){ <BR>selects[i].style.display = 'none'; <BR>select_tag = document.createElement('div'); <BR>select_tag.id = 'select_' + selects[i].name; <BR>select_tag.className = 'select_box'; <BR>selects[i].parentNode.insertBefore(select_tag,selects[i]); <BR>select_info = document.createElement('div'); <BR>select_info.id = 'select_info_' + selects[i].name; <BR>select_info.className='tag_select'; <BR>select_info.style.cursor='pointer'; <BR>select_tag.appendChild(select_info); <BR>select_ul = document.createElement('ul'); <BR>select_ul.id = 'options_' + selects[i].name; <BR>select_ul.className = 'tag_options'; <BR>select_ul.style.position='absolute'; <BR>select_ul.style.display='none'; <BR>select_ul.style.zIndex='999'; <BR>select_tag.appendChild(select_ul); <BR>rOptions(i,selects[i].name); <BR>mouseSelects(selects[i].name); <BR>if (isIE){ <BR>selects[i].onclick = new Function("clickLabels3('"+selects[i].name+"');window.event.cancelBubble = true;"); <BR>} <BR>else if(!isIE){ <BR>selects[i].onclick = new Function("clickLabels3('"+selects[i].name+"')"); <BR>selects[i].addEventListener("click", stopBubbling, false); <BR>} <BR>} <BR>} <BR>function rOptions(i, name) { <BR>var options = selects[i].getElementsByTagName('option'); <BR>var options_ul = 'options_' + name; <BR>for (n=0;n<selects[i].options.length;n++){ <BR>option_li = document.createElement('li'); <BR>option_li.style.cursor='pointer'; <BR>option_li.className='open'; <BR>$(options_ul).appendChild(option_li); <BR>option_text = document.createTextNode(selects[i].options[n].text); <BR>option_li.appendChild(option_text); <BR>option_selected = selects[i].options[n].selected; <BR>if(option_selected){ <BR>option_li.className='open_selected'; <BR>option_li.id='selected_' + name; <BR>$('select_info_' + name).appendChild(document.createTextNode(option_li.innerHTML)); <BR>} <BR>option_li.onmouseover = function(){ this.className='open_hover';} <BR>option_li.onmouseout = function(){ <BR>if(this.id=='selected_' + name){ <BR>this.className='open_selected'; <BR>} <BR>else { <BR>this.className='open'; <BR>} <BR>} <BR>option_li.onclick = new Function("clickOptions("+i+","+n+",'"+selects[i].name+"')"); <BR>} <BR>} <BR>function mouseSelects(name){ <BR>var sincn = 'select_info_' + name; <BR>$(sincn).onmouseover = function(){ if(this.className=='tag_select')this.className='tag_select_hover'; } <BR>$(sincn).onmouseout = function(){ if(this.className=='tag_select_hover') this.className='tag_select'; } <BR>if (isIE){ <BR>$(sincn).onclick = new Function("clickSelects('"+name+"');window.event.cancelBubble = true;"); <BR>} <BR>else if(!isIE){ <BR>$(sincn).onclick = new Function("clickSelects('"+name+"');"); <BR>$('select_info_' +name).addEventListener("click", stopBubbling, false); <BR>} <BR>} <BR>function clickSelects(name){ <BR>var sincn = 'select_info_' + name; <BR>var sinul = 'options_' + name; <BR>for (i=0;i<selects.length;i++){ <BR>if(selects[i].name == name){ <BR>if( $(sincn).className =='tag_select_hover'){ <BR>$(sincn).className ='tag_select_open'; <BR>$(sinul).style.display = ''; <BR>} <BR>else if( $(sincn).className =='tag_select_open'){ <BR>$(sincn).className = 'tag_select_hover'; <BR>$(sinul).style.display = 'none'; <BR>} <BR>} <BR>else{ <BR>$('select_info_' + selects[i].name).className = 'tag_select'; <BR>$('options_' + selects[i].name).style.display = 'none'; <BR>} <BR>} <BR>} <BR>function clickOptions(i, n, name){ <BR>var li = $('options_' + name).getElementsByTagName('li'); <BR>$('selected_' + name).className='open'; <BR>$('selected_' + name).id=''; <BR>li[n].id='selected_' + name; <BR>li[n].className='open_hover'; <BR>$('select_' + name).removeChild($('select_info_' + name)); <BR>select_info = document.createElement('div'); <BR>select_info.id = 'select_info_' + name; <BR>select_info.className='tag_select'; <BR>select_info.style.cursor='pointer'; <BR>$('options_' + name).parentNode.insertBefore(select_info,$('options_' + name)); <BR>mouseSelects(name); <BR>$('select_info_' + name).appendChild(document.createTextNode(li[n].innerHTML)); <BR>$( 'options_' + name ).style.display = 'none' ; <BR>$( 'select_info_' + name ).className = 'tag_select'; <BR>selects[i].options[n].selected = 'selected'; <BR>} <BR>window.onload = function(e) { <BR>bodyclick = document.getElementsByTagName('body').item(0); <BR>rSelects(); <BR>bodyclick.onclick = function(){ <BR>for (i=0;i<selects.length;i++){ <BR>$('select_info_' + selects[i].name).className = 'tag_select'; <BR>$('options_' + selects[i].name).style.display = 'none'; <BR>} <BR>} <BR>} <BR></script> <br><div style="width:500px;"> <br><form id="form1" name="form1" method="post" action="?Action=Select" style="padding:0px;"> <br><div style="width:200px; float:left; text-align:left; margin-top:8px;"> <br><div id="uboxstyle"> <br><select name="select1" id="language"> <br><option value="1">Cars...</option> <br></select> <br> </div> <br> </div> <br><div style="width:200px; float:left;text-align:left;margin-top:8px;"> <br><div id="uboxstyle"> <br><select name="select2" id="language2"> <br><option value="">all</option> <br></select> <br> </div> <br> </div> <br><div style="width:100px; float:left"> <br><input type="submit" name="button" id="button" value="" style="background-image:url(images/selectbt.jpg); width:92px; height:38px; border:0px; cursor:hand;"> <br> </div> <br> </form> </div> <br> </div>