Skip to content

Instantly share code, notes, and snippets.

@mateuspontes
Created July 7, 2011 18:10
Show Gist options
  • Save mateuspontes/1070132 to your computer and use it in GitHub Desktop.
Save mateuspontes/1070132 to your computer and use it in GitHub Desktop.
FadeIn nas imagens depois do load
<html>
<head>
<title>FadeIn images after loaded with jQuery</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("img").each(function(){
$(this).css({opacity: 0}).bind('load', function(){
$(this).animate({opacity: 1}, 'slow');
});
});
});
</script>
</head>
<body>
<img src="http://www.9zu.net/wp-content/uploads/2011/03/Lamborghini-
prototype-car-926.jpg" alt="image" width="800px"/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment