Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <img src="http://ampersandcommerce.com/assets/1Smashing_Magazine_Logo_by_TrabzonSport.png"/>
</body>
</html>
 
html,
body {
  background: #FFF;
}
img {
  max-width: 100%;
  opacity: 0;
  -webkit-transition: opacity 2000ms;
     -moz-transition: opacity 2000ms;
      -ms-transition: opacity 2000ms;
          transition: opacity 2000ms;
}
img.has-loaded {
  opacity: 1; 
}
 
var image = document.querySelector('img');
// Cover event when image has already loaded
if (image.complete) onLoad(image);
// Respond to the 'load' event
image.addEventListener('load', onLoad);
function onLoad(arg) {
  el = arg.target || arg;
  el.classList.add('has-loaded');
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
wilsonpagepro
0viewers