home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 December / PCWorld_2004-12_cd.bin / software / komercni / netgenium / NETGenium.msi / _B4A5F9DE730F039E0CBFC30C1A8A8467 / _E1129FC0C06B4E8C8AA1FCB09B9C8A6C < prev    next >
Text File  |  2004-10-01  |  1KB  |  46 lines

  1. <PUBLIC:COMPONENT>
  2.     <PUBLIC:ATTACH EVENT="onmousedown" ONEVENT="fnDown()" />
  3.     <PUBLIC:ATTACH EVENT="onclick" ONEVENT="event.cancelBubble = true;" />
  4.     <PUBLIC:ATTACH EVENT="ondblclick" ONEVENT="event.cancelBubble = true;" />
  5.     
  6.     <SCRIPT LANGUAGE="JScript">
  7.     
  8.     function fnDown()
  9.     {
  10.         element.value_ = jsNumber(element.hf.value);
  11.         element.clientX_ = event.clientX;
  12.         
  13.         event.srcElement.ondragstart = fnCancel;
  14.         
  15.         window.document.attachEvent("onmousemove", fnMove);
  16.         window.document.attachEvent("onscroll", fnMove);
  17.         window.document.attachEvent("onmouseup", fnUp);
  18.         window.document.attachEvent("onselectstart", fnCancel);
  19.     }
  20.     
  21.     function fnMove()
  22.     {
  23.         var n = element.value_ + event.clientX - element.clientX_;
  24.         if (n < 0) n = 0;
  25.         if (n > element.hf.max) n = element.hf.max;
  26.         
  27.         element.hf.value = element.lbl.innerText = element.style.marginLeft = n;
  28.         element.style.marginRight = element.hf.max - n;
  29.         element.hf.fireEvent("onchange");
  30.     }
  31.     
  32.     function fnUp()
  33.     {
  34.         window.document.detachEvent("onmousemove" , fnMove);
  35.         window.document.detachEvent("onscroll" , fnMove);
  36.         window.document.detachEvent("onmouseup" , fnUp);
  37.         window.document.detachEvent("onselectstart", fnCancel);
  38.     }
  39.  
  40.     function fnCancel()
  41.     {
  42.         return false;
  43.     }
  44.  
  45.     </SCRIPT>
  46. </PUBLIC:COMPONENT>