Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set different effects in nivo-slider

I've got a nivo-slider on my site, but there aren't any effects except slidesUp, even though I have set the default installation.

         <div class="slider-wrapper theme-default">
      <div class="ribbon"></div>
      <div id="slider" class="nivoSlider">

  <img src="/upload/banners/image1.png" border="0" alt=""/>
  <img src="/upload/banners/image2.png" border="0" alt=""/>
  <img src="/upload/banners/image3.png" border="0" alt=""/>  

      </div>
     </div>
<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider();
});
</script>   

and in header:

    <script type="text/javascript" src="/scripts/jquery.js"></script>
<script type="text/javascript" src="/scripts/jquery.nivo.slider.pack.js"></script>  
<link rel="stylesheet" type="text/css" href="/css/nivo-slider.css"/>

What should I do to make it works properly?

like image 322
Arthur Kushman Avatar asked Jun 28 '11 18:06

Arthur Kushman


1 Answers

zeusakm. Check your code and look for this:

<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider();
});
</script> 

You have to call the 'effect' option and then you can set it. How?:

<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'random'
    });
});
</script>

The effect parameter can be any of the following:

  • sliceDown
  • sliceDownLeft
  • sliceUp
  • sliceUpLeft
  • sliceUpDown
  • sliceUpDownLeft
  • fold
  • fade
  • random
  • slideInRight
  • slideInLeft
  • boxRandom
  • boxRain
  • boxRainReverse
  • boxRainGrow
  • boxRainGrowReverse

Complete reference: http://nivo.dev7studios.com/#usage

like image 191
Carlos Avatar answered Oct 05 '22 03:10

Carlos