topical media & game development
#javascript-code-07-set.js / js
// A function for setting the horizontal position of an element
function setX(elem, pos) {
// Set the ‘left’ CSS property, using pixel units
elem.style.left = pos + “px”;
}
// A function for setting the vertical position of an element
function setY(elem, pos) {
// Set the ‘left’ CSS property, using pixel units
elem.style.top = pos + “px”;
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.