jQuery Animation How to - Create fade in animation








Question

We would like to know how to create fade in animation.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.10.1.js'></script>
<style type='text/css'>
#p_load {<!-- w  w  w  . j a  v  a  2 s .  c  o m-->
  display: none;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
 $(document).ready(function() {
        $('#p_load').fadeIn(10000);
    });
});
</script>
</head>
<body>
  <p id='p_load'>hello there</p>
</body>
</html>

The code above is rendered as follows: