taron133
2020-10-26 aa8d874c8a3287d41d26566ae32b6ed8d4557ff9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<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>