I have two scripts that work great independently, and now I want to combine them. The first one is a slider that can load any content.
<script>
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 10000,
pause: 100000,
hoverPause: true,
effect: 'fade',
slidesLoaded: function() {
$('.caption').animate({
bottom:0
},200);
}
});
});
</script>
The second one is a script that can display a couple of div's with a smooth timed fade in.
<script type='text/javascript'>
$(window).load(function(){
$('.square').fadeTo(0,0).each(function(index) {
var dif = index % 5;
var lambda = parseInt(index / 8);
$(this).delay(250 * (dif + lambda)).css('visibility','visible').fadeTo(500,1)
});
});
</script>
When the page loads, different images in div's are fading in one by one. (second script). All this is in a slider div that is activated by the first script. When the slider goes to the next slide, the second script is already activated because the document was ready. I would like it to be "reset" when the second slide is activated. Then the second slide will show the second batch of images smoothly fading in, one-by-one.