I have the following code running a slideshow. I want to be able to set the duration of the interval from within the function rather than use a static value - depending on other factors I'll add in later. Is this possible? the below does not seem to work.
Thanks
$('#slideshow > div:gt(0)').hide();
setInterval(function() {
$('#slideshow > div:first')
.fadeOut(0)
.next()
.fadeIn(0)
.end()
.appendTo('#slideshow');
window.duration = 1000;
}, duration);