Skip to content

Instantly share code, notes, and snippets.

@Trindaz
Created June 21, 2014 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trindaz/a8c58d2e911ace1ca7c8 to your computer and use it in GitHub Desktop.
Save Trindaz/a8c58d2e911ace1ca7c8 to your computer and use it in GitHub Desktop.
<html>
<head>
<style>
.imageList img {
transition: opacity 2s ease;
}
.imageList img.inactive {
opacity: 0;
}
.imageList img.active {
opacity: 1;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script>
function imageLoaded(){
$('#testImage').removeClass('inactive').addClass('active');
}
</script>
</head>
<body>
<div class="imageList">
<img id="testImage" class="inactive" onLoad="imageLoaded();" src="http://i.imgur.com/6AM39pw.gif" />
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment