Moving ObjectsNow, we want to move something. It is very easy with DHTML. You just give left and top to the objects. Here is the code; moving.left = 100 moving.top = 100 Don't forget you must define moving like this; function mov() { moving = document.movingDiv } You can make moving and you can also check where the objects are. You can make alert that define where it is. alert (parseInt(moving.left)+" , "+parseInt(moving.top)) You can display position with changing method: myDivId.innerHTML = parseInt(moving.left)+" , "+parseInt(moving.top) If you do not want to repeat parseInt() just add this to script tag moving.xpos = parseInt(moving.left) moving.ypos = parseInt(moving.top) It is easy, isn't it? Try to make moving object yourself and Back to home |