Nice slider.



  • How can we make a smooth replacement of slides? (sighs) http://lol-game.ru/ Slider on the front page.

    What parameters in css or js actions are responsible? Only this part of the slider is interested.

    If javaScript is involved, I'll ask you to clarify this (and especially if jQuery).



  • The effect is called the carousel. There's a lot of reality, that's it. https://plugins.jquery.com/tag/carousel/ ♪

    It's not hard to make a choice, that's the clean JS.

    On a slide change event (the button, the keyboard arrow, the timer, something else) it is necessary that the current slide go away and the new one be " here " .

    Moving can be done in two ways:

    • changing the situation of pictures often by JS';
    • or CSS3 transitions is simply to give two slides a new position at once, the animation will be performed on the basis of CSS3 instructions. Example:

    var state = true,
        box = document.getElementById("box");
    document.getElementById("tggl").addEventListener('click', function(e){
      if(state=!state) {
        box.className = "";
      } else {
        box.className = "right";
      }
    });
    #box {
      width: 50px;
      height: 50px;
      background-color: red;
      -webkit-transition: width 2s, height 2s, background-color 2s, -webkit-transform 2s;
      transition: width 2s, height 2s, background-color 2s, transform 2s;
    }
    

    .right {
    width: 90px !important;
    height: 30px !important;
    transform: translate(500px,0px) rotate(3deg);
    }

    <div id="box"></div>

    <button type="button" id="tggl">Нажми меня</button>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2