3
Visibility.onVisible(function(){
setTimeout(function(){
$(".animar").addClass("animated fadeInDown"); }, 400);
setTimeout(function(){
$(".animar2").addClass("animated fadeInDown"); }, 800);
setTimeout(function(){
$(".animar3").addClass("animated fadeInDown"); }, 1200);
setTimeout(function(){
$(".animar4").addClass("animated fadeInDown"); }, 1600);
setTimeout(function(){
$(".animar5").addClass("animated fadeInDown"); }, 2000);
});
html,
body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
.animar,
.animar2,
.animar3,
.animar4,
.animar5 {
opacity: 0;
}
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes fadeInDown {
from {
opacity: 0;
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
@keyframes fadeInDown {
from {
opacity: 0;
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
.fadeInDown {
-webkit-animation-name: fadeInDown;
animation-name: fadeInDown;
}
<script src="http://cdnjs.cloudflare.com/ajax/libs/visibility.js/1.2.3/visibility.min.js"></script>
<div class="container">
<div class="col-md-12" style="padding: 150px; background-color: red">
<p class="animar">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
<div class="col-md-12" style="padding: 150px; background-color: green">
<p class="animar2">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
<div class="col-md-12" style="padding: 150px; background-color: white">
<p class="animar3">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
<div class="col-md-12" style="padding: 150px; background-color: yellow">
<p class="animar4">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
<div class="col-md-12" style="padding: 150px; background-color: orange">
<p class="animar5">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
This code uses a library called Visibilityjs. Every time I reload the page it causes content to appear from a smooth transition.
I want to make the content only appear with the mouse scrool/scroll.
As in this example
How can I do that?
If there is another plugin that does this also accept. My goal is to learn how to put this animation on any site.
I think it’s duplicated from http://answall.com/a/16479/129
– Sergio
It’s not no. The effect is different ;)
– Zkk
Can you explain how it’s different? That is, what’s the difference that the other link doesn’t show how to do?
– Sergio
On the other link, when you launch the mouse scrool the content is already there and has its size expanded. I want the content to be hidden and when scrolling the mouse it appears in a smooth way
– Zkk
Exactly like this: https://pages.github.com/
– Zkk
Is that how you want it? http://jsfiddle.net/Lt4ojtyp/
– Sergio