на js
<img src="http://javascript.ru/forum/image.php?u=19820&dateline=1334914235">
<img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif">
<script>
window.onload = function () {
var img = document.getElementsByTagName('img');
var int;
img[1].style.position = 'absolute';
img[1].style.left = 100 + 'px';
function goRight() {
if (parseInt(img[1].style.left) < 120) {
img[1].style.left = parseInt(img[1].style.left) + 1 + 'px'
} else {
clearInterval(int);
}
}
function goLeft() {
if (parseInt(img[1].style.left) > 100) {
img[1].style.left = parseInt(img[1].style.left) - 1 + 'px'
} else {
clearInterval(int);
}
}
img[0].onmouseover = function () {
clearInterval(int);
int = setInterval (goRight, 30);
}
img[0].onmouseout = function () {
clearInterval(int);
int = setInterval (goLeft, 30);
}
}
</script>