NivoSlider - Link after slideshow is shown + fade to white?
-
26-10-2019 - |
Question
I am using the Nivoslider script for a project of mine. Basically I'm needing to tweak the slider a little to make it do what I want it to do! I need it to do two things:
How can I make it re-direct to a new page after the slideshow is finished? I can make it stop after it cycles through, but I need it to automatically redirect to another page of the site after my images have been shown. I assume this is through using nivosliders function
lastslide
.Is there any way of making nivoSlider fade to white, then to the slide instead of crossfading? I tried to add a "white" slide in between the slides, but you can't specify seperate timing for the slides, so it stayed on this "white slide" for 4 seconds, I need it to fade to white for about 0.5 seconds then fade in the next slide.
Here is my code so far:
<script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
slices: 15, // For slice animations
boxCols: 8, // For box animations
boxRows: 4, // For box animations
animSpeed: 500, // Slide transition speed
pauseTime: 3000, // How long each slide will show
startSlide: 0, // Set starting Slide (0 index)
directionNav: false, // Next & Prev navigation
directionNavHide: true, // Only show on hover
controlNav: false, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
controlNavThumbsFromRel: false, // Use image rel for thumbs
controlNavThumbsSearch: '.jpg', // Replace this with...
controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
keyboardNav: true, // Use left & right arrows
pauseOnHover: true, // Stop animation while hovering
manualAdvance: false, // Force manual transitions
captionOpacity: 0.8, // Universal caption opacity
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
randomStart: false, // Start on a random slide
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){$('#slider').data('nivo:vars').stop = true;}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){
var $slider = $('#slider img');
$slider.css('opacity',0);
$('#preloader').fadeOut(500, function(){
$slider.animate({'opacity':1}, 500);
});
} // Triggers when slider has loaded
});
});
</script>
Thanks for any help!
Solution
For your first question, just add this line in your afterLoad function()
window.location = "http://google.com"