Куда уж проще.
Сообщение от shaltay
|
И так бесконечно.
|
вот без jQuery
<script type = "text/javascript">
window.onload = function(){
var img = document.getElementById("myimg"), open = true, width = 300, left = 0;
img.style.position = "absolute";
img.style.height = "100px";
(function(){
if(open){
img.style.left = left ++ + "px";
}
img.style.width = (open ? width -- : width ++) + "px";
if(width == 0){
open = false;
}
if(width == 300){
open = true;
}
window.setTimeout(arguments.callee, 10);
}())
}
</script>
<div class = "wrapper">
<img id = "myimg" src = "http://javascript.ru/forum/images/ca_serenity/misc/logo.gif"/>
</div>