|
= '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)); 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) this.OptionsTable.cells(i).childNodes(0).innerText = this.options[i].innerText; } } function SS_pressTitle (event) { SS_cancelEvent(event);
this.srcElementOfLastMousedown = event.srcElement;
this.toggleOptions(); } function SS_releaseTitle (event) { SS_cancelEvent(event);
if (this.isThisEventToBeCanceled(event)) return;
this.srcElementOfLastMousedown = null; } function SS_pressOption (event) { SS_cancelEvent(event);
this.srcElementOfLastMousedown = event.srcElement; } function SS_moveOption (event) { SS_cancelEvent(event);
if (this.isThisEventToBeCanceled(event)) return; if (!(event.offsetX >= 0 && event.offsetX <= this.OptionsTable.offsetWidth)) return;
this.handleOverOption(Math.floor(event.offsetY / this.OptionHeight)); } function SS_releaseOption (event) { SS_cancelEvent(event);
if (this.isThisEventToBeCanceled(event)) return;
this.srcElementOfLastMousedown = null;
if (event.offsetX >= 0 && event.offsetX <= this.OptionsTable.offsetWidth) { this.toggleOptions(false); this.select.selectedIndex = Math.floor(event.offsetY / this.OptionHeight); } } function SS_createTable () { this.Table = SS_createElement("" + "<table border=0 cellpadding=0 cellspacing=0 style='table-layout:fixed; cursor:default'>" + "<tr><td></td></tr>" + "</table>" ); 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("" + "<div style='position:relative; top:0; left:0;'>" + " <table border=0 cellpadding=0 cellspacing=1" + " height="+this.height + " bgcolor=white" + " style='table-layout:fixed; border:1 solid "+SS_ENV.CR.Border+";'" + " onmouseover='SS_VAR.SelectList["+this.ssID+"].adjustOptionsDiv()'" + " >" + " <tr>" + " <td><nobr style='text-oveflow:hidden;"+SS_ENV.OptionNobrStyle+"'></nobr></td>" + " <td width="+SS_ENV.ButtonWidth+" align=center style='word-wrap:normal'></td>" + " <td style='display:none' width="+SS_ENV.ButtonWidth+" align=center style='word-wrap:normal'></td>" + " <td style='display:none'></td>" + " </tr>" + " </table>" + "</div>" ); this.TitleTable = this.TitleDiv.childNodes(0); this.TitleTable.cells(0).childNodes(0).innerText = this.options[this.selectedIndex].innerText; this.TitleTable.cells(1).innerHTML = "<img src="/Files/BeyondPic/chinazcj/2005-11/20/05112015561126430.gif" border=0 align=absmiddle>"; this.TitleTable.cells(2).innerHTML = "<img src="/Files/BeyondPic/chinazcj/2005-11/20/05112015561169934.gif" border=0 align=absmiddle>"; this.TitleTable.cells(3).appendChild(this.select); this.TitleWrapper = document.createElement("" + "<img src="/Files/BeyondPic/chinazcj/2005-11/20/05112015561259287.gif"" + " style='position:absolute; top:0; left:0; z-index:2; width:100%; height:"+this.height+";'" + " onmouseover='SS_VAR.SelectList["+this.ssID+"].handleOverTitle()'" + " onmouseout='SS_VAR.SelectList["+this.ssID+"].handleOutTitle(); SS_VAR.SelectList["+this.ssID+"].releaseTitle(window.event);'" + " onmousedown='SS_VAR.SelectList["+this.ssID+"].pressTitle(window.event)'" + " ondblclick='SS_VAR.SelectList["+this.ssID+"].pressTitle(window.event); SS_VAR.SelectList["+this.ssID+"].releaseTitle(window.event);'" + " onmouseup='SS_VAR.SelectList["+this.ssID+"].releaseTitle(window.event)'" + " onmousewheel='SS_VAR.SelectList["+this.ssID+"].handleMousewheel(window.event)'" + " ondragstart='SS_cancelEvent(window.event)'" + ">" ); SS_CreatedElements[SS_CreatedElements.length] = this.TitleWrapper; this.TitleDiv.appendChild(this.TitleWrapper); } function SS_createOptionsDiv () { this.OptionsDiv = SS_createElement("" + "<div style='"+SS_ENV.OptionsDivStyle+"'" + " onscroll='SS_VAR.SelectList["+this.ssID+"].moveOption(window.event)'" + " onmousedown='SS_cancelEvent(window.event)'" + ">" + " <table border=0 cellpadding=0 cellspacing=0 width=100% style='table-layout:fixed'>" + " </table>" + "</div>" ); this.OptionsTable = this.OptionsDiv.childNodes(0); for (var i=0; i < this.options.length; i++) { this.createOptionTr(i); } this.syncOptions(); this.OptionsWrapper = document.createElement("" + "<img src="/Files/BeyondPic/chinazcj/2005-11/20/05112015561259287.gif"" + " style='position:absolute; top:0; left:0; width:100%;'" + " onmousedown='SS_VAR.SelectList["+this.ssID+"].pressOption(window.event)'" + " onmousemove='SS_VAR.SelectList["+this.ssID+"].moveOption(window.event)'" + " onmouseup='SS_VAR.Sel 上一页 [1] [2] [3] 下一页 没有相关教程
|