Witam,
Problem polega tym że przy ładowaniu strony wczytują się wszystkie zdjęcia i długo to zchodzi,
Jak można to poprawić? chyba że to jest złe rozwiązanie i szukać innego? (patrzyłem i wszystkie takie slidery są oparte na liscie img.
<img class="active" src="image/tlo.jpg" alt="" /> <img src="image/1.jpg" alt="" /> <img src="image/2.jpg" alt="" /> <img src="image/3.jpg" alt="" /> <img src="image/4.jpg" alt="" /> <img src="image/5.jpg" alt="" /> <img src="image/6.jpg" alt="" /> <img src="image/7.jpg" alt="" />
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
// uncomment the 3 lines below to pull the images in random order
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 30000 );
});
</script>