home *** CD-ROM | disk | FTP | other *** search
- <PUBLIC:COMPONENT lightWeight=true>
-
- <PUBLIC:EVENT name="onslidedone" ID=done>
-
- <PUBLIC:PROPERTY NAME="direction" />
- <PUBLIC:PROPERTY NAME="speed" />
- <PUBLIC:PROPERTY NAME="source" />
- <PUBLIC:PROPERTY NAME="sourceBG" />
- <PUBLIC:PROPERTY NAME="destination" />
- <PUBLIC:PROPERTY NAME="destinationBG" />
- <PUBLIC:PROPERTY NAME="endPoint" />
- <PUBLIC:PROPERTY NAME="sliding" />
-
- <PUBLIC:METHOD NAME="slide" />
-
- <SCRIPT LANGUAGE="JScript">
- var iEnd, iSpeed;
- sliding = false;
- function shimmyLeft()
- {
- var iAdjust, ssty = source.style;
- if (ssty.posLeft != iEnd)
- {
- if (direction == 1)
- {
- if ((ssty.posLeft - iEnd) < iSpeed)
- {
- iAdjust = Math.floor((ssty.posLeft - iEnd) / 4);
- if (iAdjust < 4) iAdjust = ssty.posLeft - iEnd;
- }
- else
- iAdjust = iSpeed;
- ssty.posLeft -= iAdjust;
- sourceBG.style.posLeft -= iAdjust;
- destination.style.posLeft -= iAdjust;
- }
- else
- {
- if (-(ssty.posLeft - iEnd) < iSpeed)
- {
- iAdjust = -Math.floor((ssty.posLeft - iEnd) / 4);
- if (iAdjust < 4) iAdjust = -(ssty.posLeft - iEnd)
- }
- else
- iAdjust = iSpeed;
- ssty.posLeft += iAdjust;
- sourceBG.style.posLeft += iAdjust;
- destination.style.posLeft += iAdjust;
- }
-
- window.setTimeout(shimmyLeft, 0);
- }
- else
- {
- sliding = false;
- var e = createEventObject();
- done.fire(e);
- }
- }
-
- function shimmyUp()
- {
- var iAdjust, ssty = source.style;
- if (ssty.posTop != iEnd)
- {
- if (direction == 3)
- {
- if ((ssty.posTop - iEnd) < iSpeed)
- {
- iAdjust = (ssty.posTop - iEnd) / 4;
- if (iAdjust < 4) iAdjust = ssty.posTop - iEnd
- }
- else
- iAdjust = iSpeed;
- ssty.posTop -= iAdjust;
- sourceBG.style.posTop -= iAdjust;
- destination.style.posTop -= iAdjust;
- destinationBG.style.posTop -= iAdjust;
- }
- else
- {
- if (-(ssty.posTop - iEnd) < iSpeed)
- {
- iAdjust = -(ssty.posTop - iEnd) / 4;
- if (iAdjust < 4) iAdjust = -(ssty.posTop - iEnd)
- }
- else
- iAdjust = iSpeed;
- ssty.posTop += iAdjust;
- sourceBG.style.posTop += iAdjust;
- destination.style.posTop += iAdjust;
- destinationBG.style.posTop += iAdjust;
- }
-
- window.setTimeout(shimmyUp, 0);
- }
- else
- {
- sliding = false;
- var e = createEventObject();
- done.fire(e);
- }
- }
-
- function slide()
- {
- iEnd = parseInt(endPoint);
- iSpeed = parseInt(speed);
-
- sliding = true;
- if (parseInt(direction) < 2)
- shimmyLeft();
- else
- shimmyUp()
- }
- </SCRIPT>
- </PUBLIC:COMPONENT>
-