function heroSliders() {
var $active = $('#slideshow img.active');
if ( $active.length == 0 ) $active = $('#slideshow img:last');
// use this to pul the divs in the order they appear in markup
var $next = $active.next().length ? $active.next()
: $('#slideshow img:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "heroSliders()", 3000 );
});
When the page loads all the images kind of load very quickly causing a flicker, and then the slideshow begins.
So I tried to add something similar to my slideshow code:
function heroSliders() {
var $active = $('#slideshow img.active');
if ( $active.length == 0 ) $active = $('#slideshow img:last');
// use this to pul the divs in the order they appear in markup
var $next = $active.next().length ? $active.next()
: $('#slideshow img:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$document.ready(function () {
$('#slideshow img:first-child').addClass('active');
setInterval( "heroSliders()", 5000 );
});
But it’s not working. I am learning at a steady pace, and this is probably a bit beyond where I am at the moment, but I will certainly learn from this.
I’ll respect your wish for privacy, and have had a look at the page.
I see on IE that the document ready part near the end of the heroSliders script only has a single line to start the sliders. There prior line that is supposed to set the active image isn’t up online.