simple-slider
  • Blog
  • Docs
  • Updates
Docs Menu
  • Examples
    • Custom ease animation
    • Default Sliding Transition
    • Default slider with no options
    • Fading/Opacity transition
    • Full page transition
    • Lightbox Integration
    • Mask Sliding transition
    • Pause slide
    • RequireJS usage
    • Responsive Layout Example
    • Reverse sliding direction
    • Right to left sliding transition
    • Slides containing no image
    • Top to bottom transition
    • Touch swipe example
  • API
simple-slider
  • Blog
  • Docs
  • Updates

Fading/Opacity transition Guide

Example using css opacity for a fading slides transition.

View this example

<!doctype html>
<html>
  <head>
    <title>Fade in/out transition example</title>
  </head>
  <style>
    #myslider { width:612px; height:612px; }
  </style>
  <body>
    <div id="myslider">
      <img src="http://placekitten.com/g/612/612"/>
      <img src="https://unsplash.it/612/612"/>
      <img src="https://unsplash.it/612/612?random=1"/>
      <img src="https://unsplash.it/612/612?random=2"/>
    </div>
  </body>
  <script src="https://rawgit.com/ruyadorno/simple-slider/master/dist/simpleslider.min.js"></script>
  <script>
    var imgSlider = simpleslider.getSlider({
      container: document.getElementById('myslider'),
      prop: 'opacity',
      unit: '',
      init: 0,
      show: 1,
      end: 0
    });
  </script>
</html>

Contribute on Github! Edit this section.