去掉了灰色倒三角的漂亮下拉列表(3)

2008-02-23 06:10:53来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折



   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
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: DreamweaverMX创造网页鼠标样式

下一篇: 更加便捷实用!巧妙复制主页内容另一妙法