joel dalmas
joel dalmas

Reputation: 47

jquery mouseover jitters

My Element keeps jittering up and when i mouse over the parent element? Any help would be amazing, thanks!

$(document).ready(function(){
    $("div.row1 div.one").mouseover(function() {
        $("div.row1 div.one img").animate({"bottom":"0px"}, "600"); 
    });
    $("div.row1 div.one").mouseout(function() {
        $("div.row1 div.one img").animate({"bottom":"74px"}, "600");    
    });

});




         <div class="row1">
            <div class="one">
                <div class="post_data">
                    <h1 class="post_title">The Post Title</h1>
                    <h2 class="post_snippet">Lorem Ipsum Dolar Sit Amet.</h2>
                    <p class="post_date">3/14/2012</p>
                </div> <!-- post_data //-->
            <img src="test_img1.jpg" alt="test"/>
            </div>

Upvotes: 0

Views: 527

Answers (1)

Nickolas Tuttle
Nickolas Tuttle

Reputation: 208

put a stop before animate. like this.

$(document).ready(function(){
    $("div.row1 div.one").mouseover(function() {
        $("div.row1 div.one img").stop().animate({"bottom":"0px"}, "600"); 
    }).mouseout(function() {
        $("div.row1 div.one img").stop().animate({"bottom":"74px"}, "600");    
    });

});

Upvotes: 1

Related Questions