How to make the elements appear with the mouse scrool?

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><divclass="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>

Thiscodeusesalibrarycalled 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 scrool / mouse scroll.
As in this example

How can I do this?

  

If there is another plugin that does this I also accept. My goal is to learn how to put this animation on any site.

    
asked by anonymous 11.05.2016 / 05:06

1 answer

0

Speak, Zkk! Is that okay?

Check if this article solves your problem.

The teaching is simple and in my opinion this is the easiest method to reproduce these effects. In addition, he explains about the viewport, which is an important part of the logic to create this.

Hugs!

    
25.10.2016 / 21:07