silverlight513
silverlight513

Reputation: 5647

How to animate a div to appear and move above another div

I've got this script that I have been working on and I need it to fade in and move up by it's height. If I remove the .animate() it fades in so i'm guessing theres something wrong there.

function showDesc (){
    $(".container-box").hover(function(){
        $(this).find(".contain-desc").fadeIn('slow').animate({
            'bottom':'130px'
        }, {duration: 'slow', queue: false;}
    },function(){
       $(this).find(".contain-desc").fadeOut();
    });        
}

I do have to use the old fashioned way of onmouseover="" in the html and below is my complete code so far, thanks.

http://jsfiddle.net/silverlight513/KuJkY/

Upvotes: 0

Views: 94

Answers (1)

Aashray
Aashray

Reputation: 2753

The error is here:

{duration: 'slow', queue: false;}

You have terminated the statement with a semi-colon(;)

Change it to:

{duration: 'slow', queue: false}

EDIT:

There were a couple more errors in your code. I have updated the function:

function showDesc (){
    $(".container-box").hover(function(){
        $(this).find(".contain-desc").fadeIn('slow').animate({
            'bottom':'130px'
        }, {duration: 'slow', queue: false});//This was not closed
     },function(){
       $(this).find(".contain-desc").fadeOut();
        });    
}

Upvotes: 2

Related Questions