George
George

Reputation: 2110

Google type image resize

I have the following problem-no matter how long the mouseover is I get images resized. I want the mouseover event to be 1.5 seconds(like google images don't get resized if you put the mouse over for a small period of time).Code:

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

Upvotes: 0

Views: 290

Answers (1)

genesis
genesis

Reputation: 50966

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

it works

<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>

Upvotes: 2

Related Questions