<style type="text/css">
|
div.value, div.select {
|
background-color: #FFF;
|
}
|
div.value {
|
font-size: 14px;
|
margin: 5px 0 5px 0;
|
overflow: auto;
|
border: none;
|
}
|
div.value input {
|
border: 1px 0 1px 1px #fff solid;
|
height: 28px;
|
}
|
div.select, div.list, div.option_selected {
|
font-size: 14px;
|
}
|
div.select {
|
border: 1px #000 solid;
|
}
|
div.value input, div.value img {
|
overflow: visible;
|
white-space: nowrap;
|
display: inline;
|
}
|
div.list {
|
/*padding: 0 3px 0 3px;*/
|
white-space: nowrap;
|
}
|
div.select {
|
display: none;
|
position: absolute;
|
z-index: 50;
|
overflow: auto;
|
height: 155px;
|
}
|
div.list img, div.option_selected img {
|
background-color: transparent;
|
display: inline;
|
padding: 0 3px 0 3px;
|
}
|
div.list:hover, div.option_selected, div.option_selected:hover {
|
background: #64beff;
|
}
|
div.list:hover {
|
border: none;
|
background: #64beff;
|
}
|
div.option_selected, div.option_selected:hover {
|
border: 1px #000 dashed;
|
}
|
</style>
|
<script type="text/javascript">
|
var div = GID('div_{$name}');
|
var list = GID('{$name}_list');
|
var opt = GID('{$name}_value');
|
list.style.left = div.offsetLeft+1+'px';
|
list.style.top = div.offsetTop+div.offsetHeight+1+'px';
|
var persent = {$width}/100;
|
var w = persent*div.offsetWidth-4;
|
list.style.width = w+'px';
|
opt.style.width = (w-17)+'px';
|
</script>
|
|
<select class="form-control" name="{$name}" id="{$name}" style="display: none;">
|
{if $with_choice}<option value="">{$with_choice}</option>{/if}
|
{section name=sec loop=$res}{if $res[sec][0]!==''}<option value="{$res[sec][0]}" {if $value==$res[sec][0]}selected{/if}>
|
{$res[sec][1]}
|
</option>{/if}{/section}
|
</select>
|
<div id="div_{$name}" {if $width}style="width: {$width}%;"{/if}>
|
<div class="value" onclick="openList('{$name}');"><input readonly="readonly" class="form-control" id="{$name}_value" {if $with_choice}value="{$with_choice}"{/if} type="text" autocomplete="off"><img class="x-trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" align="top"></div>
|
<div id="{$name}_list" class="select" onmouseout="createOnBlur('{$name}');" onmouseover="clearOnBlur('{$name}');">
|
{section name=sec loop=$res}
|
{if $res[sec][0]!=''}<div id="{$name}_list_{$res[sec][0]}" class="list{if $value==$res[sec][0]} option_selected{/if}" onmouseout="createOnBlur('{$name}');" onmouseover="clearOnBlur('{$name}');" onclick="clearOnBlur('{$name}'); var list_value=GID(this.id+'_value').value; list_click('{$name}', '{$res[sec][1]}'); if(this.id != SelectedList) {literal}{{/literal}{$add_str} {literal}}{/literal} selectList(this.id); createOnBlur('{$name}'); ">
|
<input id="{$name}_list_{$res[sec][0]}_value" type="hidden" class="form-control" value="{$res[sec][0]}">
|
{if $res[sec][2]!=''}<img src="{$res[sec][2]}" alt="" align="top">{/if}<span>{$res[sec][1]}</span>
|
</div>{/if}
|
{/section}
|
</div>
|
</div>
|