去掉了灰色倒三角的漂亮下拉列表(3)
2008-02-23 06:10:53来源:互联网 阅读 ()
this.TitleTable.cells(0).childNodes(0).innerText = this.options[this.selectedIndex].innerText;
if (this.bExpanded)
this.toggleOptions(false);
}
function SS_toggleTitle (bReverse)
{
this.bReverse = ('undefined'!=typeof(bReverse)) ? bReverse: (!this.bReverse);
this.TitleTable.cells(0).style.backgroundColor = this.bReverse ? SS_ENV.CR.ReverseBackground : '';
this.TitleTable.cells(0).style.color = this.bReverse ? SS_ENV.CR.ReverseText : '';
}
function SS_toggleOptions (bExpanded, bStrict)
{
if (!bStrict && !this.bFocused) {
SS_blurExcept(this.ssID);
}
this.bExpanded = ('undefined'!=typeof(bExpanded)) ? bExpanded: (!this.bExpanded);
if (this.bExpanded) {
this.adjustOptionsDiv();
this.OptionsDiv.style.display = 'block';
if (!bStrict) {
this.toggleTitle(false);
this.handleOverOption(this.selectedIndex);
}
this.handleOutTitle();
}
else {
this.OptionsDiv.style.display = 'none';
if (!bStrict) {
this.toggleTitle(true);
}
}
if (!bStrict) {
this.bFocused = true;
if (!SS_VAR.bEventAttached) {
document.attachEvent('onmousedown', SS_blurExcept);
document.attachEvent('ondblclick', SS_blurExcept);
SS_VAR.bEventAttached = true;
}
}
}
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));
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇: 更加便捷实用!巧妙复制主页内容另一妙法
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
