Google类型图片调整大小

时间:2011-07-14 22:46:36

标签: jquery image resize

我有以下问题 - 无论鼠标悬停多长时间我都会调整图像大小。我希望鼠标悬停事件为1.5秒(如果你将鼠标放在一小段时间内,谷歌图像不会调整大小)。代码:

$('a img').mouseover(function(){
            $(this).delay(1500).animate({
                width: "315px",
                height: "225px",
                marginLeft: "-50px"
            }, 1500 );
        }); 

1 个答案:

答案 0 :(得分:2)

http://sandbox.phpcode.eu/g/nyan-.php

它有效 http://img.karaoketexty.cz/img/artists/37103/nyan-cat-229003.gif

<a href=""><img src="http://img.karaoketexty.cz/img/artists/37103/nyan-cat-229003.gif" width="145" height="125"/></a>
<script>
$('a img').hover(function(){
            $(this).delay(1500).animate({
                width: "315px",
                height: "225px",
            }, 100 );
        });
$('a img').mouseout(function(){

            $(this).animate({
                width: "115px",
                height: "125px",
            }, 1000 );

}); </script>