Skip to content

Instantly share code, notes, and snippets.

@LowerDeez
Last active June 10, 2017 22:31
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 LowerDeez/774e6ff25acc61fb54ec3eab1ff2c58b to your computer and use it in GitHub Desktop.
Save LowerDeez/774e6ff25acc61fb54ec3eab1ff2c58b to your computer and use it in GitHub Desktop.
JavaScripts (Animate CSS + WayPoints javaScript Plugin) Добавление анимации секциям при скролле
function m(value) {
//$r = $(".s-how-to-order").animated('fadeInUp', 'fadeOutDown');
var inEffect = "fadeInUp"
var outEffect = "fadeOutDown"
var $r = $(value);
$r.css("opacity", "0").addClass("animated").waypoint(function (dir) {
if (dir == 'down') {
$r.removeClass(outEffect).addClass(inEffect).css("opacity", "1");
} else {
$r.removeClass(inEffect).addClass(outEffect).css("opacity", "1");
}
}, {'offset': '90%'});
};
$(function(){
m('.s-about');
m('.s-contacts');
m('.s-how-to-order');
m('.s-description');
m('.s-discount');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment