Last active
June 10, 2017 22:31
-
-
Save LowerDeez/774e6ff25acc61fb54ec3eab1ff2c58b to your computer and use it in GitHub Desktop.
JavaScripts (Animate CSS + WayPoints javaScript Plugin) Добавление анимации секциям при скролле
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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