Bug in 2/14!


The default code that is set up for 2.More Practice with .animate(), is flawed. There is a curly bracket after 500 instead of after '-='.

So instead of:
$( ).animate({ top: '-=', 500 });
it should be
$( ).animate({ top: '-='}, 500);

Just in case anyone gets stuck.


Then in your corrected-code remove the second closing-curly-bracket-}



Thank you. How embarrassing! XD


Another problem I found is they started us with the wrong operation. You need to make -= into += to complete this.
When you run it after you apply that correction you will get an error that say's that top counter should be increasing.


O ya, I had to make the thing increase not decrease


Here is my code:
// Fill in the blanks!
$('img').animate({ top: '+= 100px' , 1000});
It rells me it should be increasing not decreasing


problem area:

i've pointed to the areas that need corrected...

your code:

$('img').animate({top: += 100px', 1000});
                       ^              ^

needs to be:

$('div').animate({top: -= 100px'}, 1000);

                       ^        ^

your code should like this now:

$(document).ready(function() {

hope this helps :)


which is ridiculous, as they tell us the opposite in the instructions.


It still doesn't work for me, even though code should be correct.

$(document).ready(function() {
    // Fill in the blanks!
    $('img').animate({top:'+= 100px'},1000);


ok, I had unnecessary space after +=