home *** CD-ROM | disk | FTP | other *** search
- <PUBLIC:COMPONENT>
- <PUBLIC:ATTACH EVENT="onmousedown" ONEVENT="fnDown()" />
- <PUBLIC:ATTACH EVENT="onclick" ONEVENT="event.cancelBubble = true;" />
- <PUBLIC:ATTACH EVENT="ondblclick" ONEVENT="event.cancelBubble = true;" />
-
- <SCRIPT LANGUAGE="JScript">
-
- function fnDown()
- {
- element.value_ = jsNumber(element.hf.value);
- element.clientX_ = event.clientX;
-
- event.srcElement.ondragstart = fnCancel;
-
- window.document.attachEvent("onmousemove", fnMove);
- window.document.attachEvent("onscroll", fnMove);
- window.document.attachEvent("onmouseup", fnUp);
- window.document.attachEvent("onselectstart", fnCancel);
- }
-
- function fnMove()
- {
- var n = element.value_ + event.clientX - element.clientX_;
- if (n < 0) n = 0;
- if (n > element.hf.max) n = element.hf.max;
-
- element.hf.value = element.lbl.innerText = element.style.marginLeft = n;
- element.style.marginRight = element.hf.max - n;
- element.hf.fireEvent("onchange");
- }
-
- function fnUp()
- {
- window.document.detachEvent("onmousemove" , fnMove);
- window.document.detachEvent("onscroll" , fnMove);
- window.document.detachEvent("onmouseup" , fnUp);
- window.document.detachEvent("onselectstart", fnCancel);
- }
-
- function fnCancel()
- {
- return false;
- }
-
- </SCRIPT>
- </PUBLIC:COMPONENT>