<style>
#_contents{
display: flex;
display: -webkit-flex;
display: -webkit-box;
display: -moz-flex;
}
#_contents select{
width:50px;
}
</style>
<script>
var str = "";
document.writeln("<div class=\"aui-content aui-margin-b-15\">");
str += "<ul class=\"aui-list aui-form-list\">";
str += "<li class=\"aui-list-item\">";
str += "<div class=\"aui-list-item-inner\">";
str += "<div class=\"aui-list-item-label\">时间段</div>";
str += "<div class=\"aui-list-item-input\" id=\"_contents\" visibility:hidden\>";
str += "<select name=\"starhour\" id=\"starhour\">";
for (h = 6; h <= 9; h++) {
str += "<option value=\"0" + h + "\">0" + h + "</option>";
}
for (h = 10; h <= 20; h++) {
str += "<option value=\"" + h + "\">" + h + "</option>";
}
str += "</select>";
str += "<select name=\"starminute\" id=\"starminute\">";
for (m = 0; m <= 0; m++) {
str += "<option value=\"0" + m + "\">0" + m + "</option>";
}
for (m = 3; m <= 3; m++) {
str += "<option value=\"" + m + "\">" + m + "0</option>";
}
str += "</select>";
str += "<select name=\"endhour\" id=\"endhour\">";
for (h = 6; h <= 9; h++) {
str += "<option value=\"0" + h + "\">0" + h + "</option>";
}
for (h = 10; h <= 20; h++) {
str += "<option value=\"" + h + "\">" + h + "</option>";
}
str += "</select>";
str += "<select name=\"endminute\" id=\"endminute\">";
for (m = 0; m <= 0; m++) {
str += "<option value=\"0" + m + "\">0" + m + "</option>";
}
for (m = 3; m <= 3; m++) {
str += "<option value=\"" + m + "\">" + m + "0</option>";
}
str += "</select>";
str += "</div>";
str += "</div>";
str += "</li>";
str += "</ul>";
str += "<div class=\"aui-btn aui-btn-info\">";
str += "<input name=\"queding\" type=\"button\" onclick=\"_select()\" value=\"\u786e\u5b9a\" style=\"font-size:12px\" /></div>";
str += "</div>";
document.writeln(str);
var _fieldname;
function _SetTime(tt) {
_fieldname = tt;
var ttop = tt.offsetTop; //TT控件的定位点高
var thei = tt.clientHeight; //TT控件本身的高
var tleft = tt.offsetLeft; //TT控件的定位点宽
while (tt = tt.offsetParent) {
ttop += tt.offsetTop;
tleft += tt.offsetLeft;
}
document.all._contents.style.top = ttop + thei + 4;
document.all._contents.style.left = tleft;
document.all._contents.style.visibility = "visible";
}
function _select() {
_fieldname = $api.val($api.byId('starhour')) + ":" + $api.val($api.byId('starminute')) + "~" + $api.val($api.byId('endhour')) + ":" + $api.val($api.byId('endminute'));
$api.html($api.byId('time'), _fieldname);
}
</script>
<body>
<input name="star" id="star" type="text" readonly onclick="_SetTime(this)"/>
<div id="time"></div>
</body>