jackpot 01

In this example below you will see how to do a jackpot 01 with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by benoitwimart, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright benoitwimart ©
  • HTML
  • CSS
  • JavaScript
    <div id="one">
  <ul>
    <li>5</li>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>1</li>
  </ul>
</div>

/*Downloaded from https://www.codeseek.co/benoitwimart/jackpot-01-zjPebg */
    body{
  font-family:sans-serif;
}
#one{
  width:30px;
  height:30px;
  overflow:hidden;
}
ul{
  margin:0;
  padding:0;
}

li{
  display:block;
  height:30px;
  line-height:30px;
  width:30px;
}


/*Downloaded from https://www.codeseek.co/benoitwimart/jackpot-01-zjPebg */
    TweenMax.to('ul',5,
 {y:-600, // 600 = 150 * 4 on tombe sur le 1er 5
  modifiers:{
  y:function(y){
      var newY = y % 150; // 150 = 5 * 30
      return newY;
   }
  }
 })

Comments