GDES-315 Exercise_15.2

Simple slideUp() and fadeTo() methods

by emilytrabert

HTML

<body>
    <div class="blue">
       Wehn the page is ready, i slide up!
    </div>
    <div class="red">
        When the page is ready i will fade out !
    </div>
</body>

CSS

.blue{background-color: #48b6c2;}
.red{background-color: #c44f63; }


div{
    width: 300px;
    margin: 10px;
    padding: 55px;
    color: #FFF
}

JavaScript

/* Write code that executes the following:*/

/*
1. When the document is ready, a blue box slides up in 400ms
*/                   

$(document).ready(function(){
    $('.blue').slideUp();
});
/*
2. When the document is ready, a red box fades out in 4000 ms
*/

$(document).ready(function(){
    $('.red').fadeOut(4000);
});