All pastes #241092 Raw Edit

Stuff

public javascript v1 · immutable
·published 2006-11-06 00:32 UTC
rendered paste body
/*    New Perspectives on JavaScript   Tutorial 4   Case Problem 2   The Chamberlain Civic Center   Name:    Date:    Function List:   placeIt(id, x, y)      Places the id object at the page coordinates (x,y)   shiftIt(id, dx, dy)      Shifts the id object dx pixels to the left and dy pixels down   yCoord(id)      Returns the y-coordinate of the id object*/function placeIt(id, x, y) {   object = document.getElementById(id);   object.style.left=x+"px";   object.style.top=y+"px";}function shiftIt(id, dx, dy) {   object = document.getElementById(id);   object.style.left = xCoord(id)+dx+"px";   object.style.top = yCoord(id)+dy+"px";}function yCoord(id) {   object=document.getElementById(id);   yc=parseInt(object.style.top);   return yc;}