[js] $(function() { show(); $("div#right").click(function () { x = x+1; y = y; show(); }); $("div#left").click(function () { x = x-1; y = y; show(); }); $("div#top").click(function () { x = x; y = y-1; show(); }); $("div#bottom").click(function () { x = x; y = y+1; show(); }); });[/js]
ну в ф-цию можно это всё кинуть [js]function moveit(xn,yn) { x += xn; y += yn; show(); }[/js] дальше в каждом диве ставим onclick="moveit(0,-1)"