Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <button>Add Stuff</button>
</body>
</html>
 
.article { 
  opacity: 0;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
}
.article.animate { 
    opacity: 1;
}
 
$('button').click(function() {
  var $articleHTML = $(
  '<article class="article">' +
    '<a href=""><img src="http://placehold.it/100x100" alt=""></a>' +
    '<h1><a href="">article.reviewTitle</a></h1>' +
    '<p><a href="">article.reviewSummary</a></p>' +
  '</article>');
  $('body').append($articleHTML);
  $a = $('body').find("article");
  reDraw($a).then(function() {
    $a.addClass("animate");
  });
});
function reDraw($element) {
  var deferred = new $.Deferred();
  setTimeout(function() {
    var h = $element[0].offsetHeight;
    var s = $element[0].getComputedStyle;
    deferred.resolve();
  },0);
  return deferred.promise();
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers