|
July 27, 2000 The removeExpression() Method Tips: July 2000
Yehuda Shiran, Ph.D.
|
|
Sometimes a formula that sets the
position of the element forever is too restrictive. To relax the binding between
the element property and the expression currently assigned to it, use the removeExpression()
to remove the expression from the property of an element. The general syntax is:
In Column 65, Dynamic Properties, we showed how to program the Solar System. To remove the expression for the
One of the script's features is that the user may move the Sun to anywhere on the page, by clicking on it, moving the cursor (without pressing), and then terminating the dragging by another mouse click. The Sun is initially set at the center of the client area, using dynamic properties:
But after the user moves the
Sun, leaving the expressions as they are will yield repositioning the Sun to
the center of the client area, nullifying the user's actions. To avoid that
problem, we remove the expression in the
This function is called whenever
the user clicks the mouse. According to the For more on Dynamic Properties, go to Column 65, Dynamic Properties.
People who read this tip also read these tips: Look for similar tips by subject: |