Javascript, show div element when it appears on screen

im trying to build code than animates some divs when they appear with the help of this code http://jsfiddle.net/tcloninger/e5qaD/
so far i have write this code

<script>
$(document).ready(function() {
 
    /* Every time the window is scrolled ... */
    $(window).scroll( function(){
 
        /* Check the location of each desired element */
        $('#art-1').each( function(i){
 
            var bottom_of_object = $(this).position().top + $(this).outerHeight();
            var bottom_of_window = $(window).scrollTop() + $(window).height();
 

Syndicate content