Created
October 7, 2011 20:18
-
-
Save noeltock/1271263 to your computer and use it in GitHub Desktop.
Nivo Random Starting Slide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You'll find this in header.php: | |
| <!-- / Nivo Slider --> | |
| <script type="text/javascript"> | |
| jQuery(window).load(function() { | |
| jQuery('#slider').nivoSlider({ | |
| effect:'fade', | |
| pauseTime:'3000', | |
| boxCols: 8, // For box animations | |
| boxRows: 3, // For box animations | |
| controlNav:false, | |
| directionNav:false, | |
| captionOpacity:0.8 | |
| }); | |
| }); | |
| </script> | |
| <!-- / Nivo Slider --> | |
| Change it to this: | |
| <!-- / Nivo Slider --> | |
| <script type="text/javascript"> | |
| jQuery(window).load(function() { | |
| var total = $('#slider img').length; | |
| var rand = Math.floor(Math.random()*total); | |
| jQuery('#slider').nivoSlider({ | |
| startSlide:rand | |
| effect:'fade', | |
| pauseTime:'3000', | |
| boxCols: 8, // For box animations | |
| boxRows: 3, // For box animations | |
| controlNav:false, | |
| directionNav:false, | |
| captionOpacity:0.8 | |
| }); | |
| }); | |
| </script> | |
| <!-- / Nivo Slider --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment