📄 selects.js
字号:
selects = {
add: function(strid, strero, strers)
{
var tobj = strid;
if (tobj)
{
var ti, tstr, tisext;
for (ti = 0; ti < tobj.options.length; ti ++)
{
if (tobj.options[ti].text == strero && tobj.options[ti].value == strers)
{tisext = true;}
}
if (!tisext){tobj.options.add(new Option(strero, strers));}
}
},
remove: function(strid)
{
var tobj = strid;
if (tobj)
{
var tidx = tobj.selectedIndex;
if (!(tidx == -1)){tobj.options[tidx] = null;}
}
},
displace: function(strid, strindex, strkey)
{
if (strindex >= 0)
{
var tobj = strid;
if (tobj)
{
var tstrvalue, tstrtext;
tstrtext = tobj.options[strindex].text;
tstrvalue = tobj.options[strindex].value;
if (strkey == 38)
{
if (!(strindex == 0))
{
tobj.options[strindex].text = tobj.options[strindex - 1].text;
tobj.options[strindex].value = tobj.options[strindex - 1].value;
tobj.options[strindex - 1].text = tstrtext;
tobj.options[strindex - 1].value = tstrvalue;
}
}
if (strkey == 40)
{
if (!(strindex == (tobj.options.length - 1)))
{
tobj.options[strindex].text = tobj.options[strindex + 1].text;
tobj.options[strindex].value = tobj.options[strindex + 1].value;
tobj.options[strindex + 1].text = tstrtext;
tobj.options[strindex + 1].value = tstrvalue;
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -