Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var width = $(window).width();
var data = [
  { el: '#about .image img.flex', plus: 600, newClass: "slideLeft" },
  { el: '#author .image img.flex', plus: 600, newClass: "slideRight" },
  { el: '#feed .blog_01', plus: 600, newClass: "oneUp" },
  { el: '#feed .blog_02', plus: 600, newClass: "twoUp" },
  { el: '#feed .blog_03', plus: 600, newClass: "thrUp" },
  { el: '#feed .more', plus: 1000, newClass: "moreUp" }
];
if(width >= 1025) {
  $(window).scroll(function() {
    data.forEach(function(d) {
      $(d.el).each(function() {
        var position = $(this).offset().top;
        var top = $(window).scrollTop();
        if (position < (top + d.plus)) { $(this).addClass(d.newClass); }
      });
    });
  });
} else { 
  data.forEach(function(d) {
    $(d.el).addClass('visible');
  });
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers