一个漂亮的下拉列表,去掉了灰色倒三角按钮
很漂亮,比较适合女性一类比较温馨的网站
漂亮的下拉框
// ViaSelect Environment Constants
var SS_ENV = new Object();
SS_ENV.IE_Version = new Number(((window.navigator.appVersion.split('; '))[1].split(' '))[1]);
SS_ENV.CR = new Object();
SS_ENV.CR.ReverseBackground = '#E2519C';
SS_ENV.CR.ReverseText = 'white';
SS_ENV.CR.Border = '#D55C9A';
SS_ENV.CR.BorderActive = '#FF6CB7';
SS_ENV.ImgPrefix = 'http://www.viafriend.com/images';
SS_ENV.DefaultHeight = 20;
SS_ENV.ButtonWidth = 13;
SS_ENV.OptionsDivStyle = ''
+ ' display:none;'
+ ' z-index:10;'
+ ' position:absolute;'
+ ' border:1 solid '+ SS_ENV.CR.Border+';'
+ ' background-color:white;'
+ ' scrollbar-face-color:#D4D0C8;'
+ ' scrollbar-shadow-color:white;'
+ ' scrollbar-highlight-color:#F6F5F4;'
+ ' scrollbar-3dlight-color:white'
+ ' scrollbar-darkshadow-color:#86837E;'
+ ' scrollbar-track-color:#F6F5F4;'
+ ' scrollbar-arrow-color:#86837E;';
SS_ENV.OptionNobrStyle = ''
+ ' font-size:12px;'
+ ' font-family:奔覆;';
// SaySelect Variables
var SS_VAR = new Object();
SS_VAR.DivDummy = document.createElement("DIV");
SS_VAR.SelectList = new Array();
SS_VAR.bEventAttached = false;
var SS_CreatedElements = new Object();
function unloadObjects()
{
try {
if (SS_VAR && SS_VAR.SelectList)
{
for (key in SS_VAR.SelectList)
{
if (SS_VAR.SelectList[key])
{
try {
SS_VAR.SelectList[key].select.setAttribute('SS', 0);
} catch (e) {};
delete SS_VAR.SelectList[key];
}
}
}
} catch (e) {};
}
attachEvent("onunload", unloadObjects);
function SS_create (srcHTML, ListMax, bAutoDetect)
{
// property
this.ssID = SS_VAR.SelectList.length;
this.bOriginalSelect = (bAutoDetect && SS_ENV.IE_Version
\n");
document.all.SS_TempDiv.appendChild(this.Table);
document.all.SS_TempDiv.removeNode();
}
function SS_write (srcHTML, ListMax, bAutoDetect)
{
var oSS = new SS_create(srcHTML, ListMax, bAutoDetect);
oSS.display();
return oSS;
}
function SS_insertOption (value, innerText, idx)
{
var NewOption = document.createElement("OPTION");
SS_CreatedElements[SS_CreatedElements.length] = NewOption;
this.options.add(NewOption, idx);
NewOption.innerText = innerText;
NewOption.value = value;
if (!this.bOriginalSelect)
this.createOptionTr(idx);
this.syncOptions();
this.adjustOptionsDiv();
this.syncSelectedIndex();
}
function SS_deleteOption (idx)
{
this.options.remove(idx);
if (!this.bOriginalSelect)
this.OptionsTable.deleteRow(idx);
this.syncOptions();
this.adjustOptionsDiv();
this.syncSelectedIndex();
}
function SS_changeOption (idx, value, innerText)
{
this.options[idx].value = value;
this.options[idx].innerText = innerText;
this.syncOptions();
this.syncSelectedIndex();
}
function SS_cancelEvent (event)
{
event.cancelBubble = true;
event.returnValue = false;
}
function SS_isThisEventToBeCanceled (event)
{
if ('object' == typeof(event)) {
switch (event.type) {
case 'mousedown':
if (!(event.button & 1)) return true;
break;
case 'mouseup':
if (!(event.button & 1)) return true;
if (SS_ENV.IE_Version >= 5.5 && event.srcElement != this.srcElementOfLastMousedown && this.srcElementOfLastMousedown != null) {
this.srcElementOfLastMousedown = null;
return true;
}
break;
case 'mouseout':
if (!(SS_ENV.IE_Version = 5.5 && event.srcElement != this.srcElementOfLastMousedown && this.srcElementOfLastMousedown != null)
return true;
break;
}
}
return false;
}
function SS_createElement (html)
{
SS_VAR.DivDummy.insertAdjacentHTML('afterBegin', html);
var oEl = SS_VAR.DivDummy.children(0);
while (SS_VAR.DivDummy.children.length > 0) {
SS_VAR.DivDummy.removeChild(SS_VAR.DivDummy.children(0));
}
return oEl;
}
function SS_blurExcept (except)
{
SS_cancelEvent(window.event);
except = ('number'==typeof(except)) ? except : -1;
var bHasToDetachEvent = true;
for (var i=0; i event.wheelDelta; i -= 120)
idx++;
}
idx = Math.max(idx, 0);
idx = Math.min(idx, this.options.length - 1);
this.select.selectedIndex = idx;
}
function SS_handleOverTitle ()
{
if (this.bExpanded)
return;
this.TitleTable.style.borderColor = SS_ENV.CR.BorderActive;
this.TitleTable.cells(1).style.display = 'none';
this.TitleTable.cells(2).style.display = 'block';
}
function SS_handleOutTitle ()
{
this.TitleTable.style.borderColor = SS_ENV.CR.Border;
this.TitleTable.cells(2).style.display = 'none';
this.TitleTable.cells(1).style.display = 'block';
}
function SS_handleOverOption (idx)
{
for (var i=0; i this.ListMax) ? 'scroll' : '';
var top = this.Table.offsetTop;
var left = this.Table.offsetLeft;
for (var El = this.Table.offsetParent; 'BODY'!=El.tagName && 'absolute'!=El.style.position && 'relative'!=El.style.position; El = El.offsetParent) {
if ('TABLE' != El.tagName) {
top += El.clientTop;
left += El.clientLeft;
}
top += El.offsetTop;
left += El.offsetLeft;
}
this.OptionsDiv.style.top = (this.bListDown) ? (top + this.height) : (top - parseInt(this.OptionsDiv.style.height));
this.OptionsDiv.style.left = left;
this.TitleWrapper.style.top = 0;
this.TitleWrapper.style.left = 0;
}
function SS_syncOptions ()
{
if (this.bOriginalSelect) return;
for (var i=0; i = 0 && event.offsetX = 0 && event.offsetX "
+ "
"
+ "
"
);
if (!isNaN(this.width))
this.Table.style.width = this.width;
this.Table.style.height = this.height;
if (!this.bOriginalSelect) {
this.createTitleDiv();
this.createOptionsDiv();
this.Table.cells(0).appendChild(this.TitleDiv);
this.Table.cells(0).appendChild(this.OptionsDiv);
}
else {
this.Table.cells(0).appendChild(this.select);
}
}
function SS_createTitleDiv ()
{
this.TitleDiv = SS_createElement(""
+ "
"
+ "
"
+ "
"
);
this.TitleTable = this.TitleDiv.childNodes(0);
this.TitleTable.cells(0).childNodes(0).innerText = this.options[this.selectedIndex].innerText;
this.TitleTable.cells(1).innerHTML = "";
this.TitleTable.cells(2).innerHTML = "";
this.TitleTable.cells(3).appendChild(this.select);
this.TitleWrapper = document.createElement(""
+ ""
);
SS_CreatedElements[SS_CreatedElements.length] = this.TitleWrapper;
this.TitleDiv.appendChild(this.TitleWrapper);
}
function SS_createOptionsDiv ()
{
this.OptionsDiv = SS_createElement(""
+ "
"
+ "
"
+ "
"
);
this.OptionsTable = this.OptionsDiv.childNodes(0);
for (var i=0; i "
);
SS_CreatedElements[SS_CreatedElements.length] = this.OptionsWrapper;
this.OptionsDiv.appendChild(this.OptionsWrapper);
}
function SS_createOptionTr (idx)
{
idx = ('undefined'!=typeof(idx)) ? idx : this.options.length - 1;
var OptionTr = this.OptionsTable.insertRow(-1);
var OptionTd = document.createElement("
");
SS_CreatedElements[SS_CreatedElements.length] = this.OptionsTd;
OptionTd.appendChild(document.createElement(""));
OptionTr.appendChild(OptionTd);
}
SS_write("\n"
+" 不限\n"
+"水瓶座"
+"双鱼座"
+"白羊座"
+"金牛座"
+"双子座"
+"巨蟹座"
+"狮子座"
+"处女座"
+"天秤座"
+"天蝎座"
+"射手座"
+"摩羯座"
+"\n");
SS_write("\n"
+"都行\n"
+"北京"
+"上海"
+"天津"
+"重庆"
+"安徽"
+"福建"
+"甘肃"
+"广东"
+"广西"
+"贵州"
+"海南"
+"河北"
+"黑龙江"
+"河南"
+"湖北"
+"湖南"
+"内蒙古"
+"江苏"
+"江西"
+"吉林"
+"辽宁"
+"宁夏"
+"青海"
+"山西"
+"陕西"
+"山东"
+"四川"
+"江西"
+"西藏"
+"新疆"
+"云南"
+"浙江"
+"其它"
+"\n",8);
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]