JavaScript API
Move Page Element - moveXY()
Move the element "myObject" to screen co-ordinates x, y.
NOTE: All browsers except Opera 5 use the "px" suffix. Otherwise, when the doctype of your document is specified as HTML4.0 in the DOM browsers, the function will not work.
The Code
function moveXY(myObject, x, y) {
obj = getStyleObject(myObject);
if (ns4) {
obj.top = y;
obj.left = x;
} else {
if (op5) {
obj.pixelTop = y;
obj.pixelLeft = x;
} else {
obj.top = y + 'px';
obj.left = x + 'px';
}
}
}
|