去掉了灰色倒三角的漂亮下拉列表(4)_Dreamweaver教程
}
}
}
function SS_handlePropertychange ()
{
if ('propertychange'==window.event.type && 'selectedIndex'==window.event.propertyName) {
var oSS = window.event.srcElement.SS;
oSS.syncSelectedIndex();
if (null != oSS.select.onchange)
oSS.select.onchange();
}
}
function SS_handleMousewheel (event)
{
var idx = this.selectedIndex;
if ('mousewheel'==event.type && this.bFocused && this.bReverse) {
for (var i=0; i < event.wheelDelta; i = 120)
idx--;
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.options.length; i ) {
if (i==idx)
this.turnOnOption(i);
else
this.turnOffOption(i);
}
}
function SS_turnOnOption (idx)
{
this.OptionsTable.cells(idx).style.color = SS_ENV.CR.ReverseText;
this.OptionsTable.cells(idx).style.backgroundColor = SS_ENV.CR.ReverseBackground;
}
function SS_turnOffOption (idx)
{
this.OptionsTable.cells(idx).style.color = '';
this.OptionsTable.cells(idx).style.backgroundColor = '';
}
function SS_adjustOptionsDiv ()
{
if (this.bOriginalSelect) return;
this.OptionsDiv.style.width = this.width;
this.OptionsDiv.style.height = Math.min(this.options.length, this.ListMax) * this.OptionHeight 2;
this.OptionsWrapper.style.height = this.options.length * this.OptionHeight;
this.OptionsDiv.style.overflowY = (this.options.length > 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 < this.options.length; i ) {
this.OptionsTable.cells(i).setAttribute('index', i);
if (this.OptionsTable.cells(i).childNodes(0).innerText != this.options[i].innerText)
- 相关链接:
- 教程说明:
Dreamweaver教程-去掉了灰色倒三角的漂亮下拉列表(4)。