Effect for two Ivs to move to opposite sides

Asked

Viewed 118 times

0

I need two divs have the transition effect equal to of that website (press the arrow keys on the keyboard "UP" and "Down" to see what I’m talking about).

I need that when the user rolls the scroll down, the divs and its contents change according to the example I mentioned. That is, when it is scrolled down, the DIV from the left goes up and from the right goes down. This alternation can be random.

.left{
  float: left;
  height: 1000px;
  width: 50%;
}
.right{
  float:right;
  height: 1000px;
  width: 50%;
}
#tela1 .left{
    background:#000;
}
#tela1 .right{
    background:#888;
}
#tela2 .left{
    background:#689;
}
#tela2 .right{
    background:#366;
}
       <div id="tela1">
           <div class="left">
               Conteúdo da esquerda que move para baixo
           </div>
           <div class="right">
               Conteúdo da direita que move para cima
           </div>
        </div>
      <div id="tela2">
           <div class="left">
               Conteúdo da esquerda que move para baixo
           </div>
           <div class="right">
               Conteúdo da direita que move para cima
           </div>
        </div>

I posted the my structure here:

  • Do you want to do this with keyboard too? I propose that you place an image on your fidde so that we can give an example. Meanwhile take a look here: http://jsfiddle.net/j1vhzpf2/

  • follow @Sergio’s idea and use a keyup/keydown http://www.w3schools.com/jquery/event_keydown.asp

  • You can use a Framework, for example, Skrollr, or another Parallax scrolling for the most. http://prinzhorn.github.io/skrollr/ There are some good options, search for "Javascript Scroll Framework".

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.