Skip to content

Instantly share code, notes, and snippets.

@dkruchok
Created August 6, 2015 07:05
Show Gist options
  • Save dkruchok/e068e5e524126b2e6239 to your computer and use it in GitHub Desktop.
Save dkruchok/e068e5e524126b2e6239 to your computer and use it in GitHub Desktop.
Animate Css
(function($) {
$.fn.animated = function(inEffect, outEffect) {
$(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
$(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
} else {
$(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
};
}, {
offset: "90%"
}).waypoint(function(dir) {
if (dir === "down") {
$(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
} else {
$(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
};
}, {
offset: -$(window).height()
});
};
})(jQuery);
$('.people_wrapp, .entry_left, .item_l, .owl-item').animated("slideInLeft", 'slideOutLeft');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment