Ahojte, mám taký problém. Mám vytvorený image slider no ked prepínam medzi stránkami a vrátim sa po chvíli tak mi bugne. Bude lepšie ak to uvidíte na vlastné oči. Netuším čo za tým môže byť. Tu je kód:
HTML
<div id="banner">
<div id="one" class="cover"></div>
<div id="two" class="cover"></div>
<div id="three" class="cover"></div>
<div id="four" class="cover"></div>
<div id="five" class="cover"></div>
</div>
CSS
#banner {
position: relative;
max-width: 100%;
min-height: 25em;
background-color: #aaa;
}
.cover {
width: 100%;
min-height: 25em;
position: absolute;
left: 0;
top: 0;
}
#one,
#two,
#three,
#four,
#five {
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
/*background-attachment: fixed;*/
}
#one {
background-image: url('../img/pictures/british-airways-2132653_1920.jpg');
}
#two {
background-image: url('../img/pictures/earth-11595_1920.jpg');
}
#three {
background-image: url('../img/pictures/norway-2083189_1920.jpg');
}
#four {
background-image: url('../img/pictures/travel-1756150_1920.jpg');
}
#five {
background-image: url('../img/pictures/road-2068900_1920.jpg');
}
JS
covers = $('#banner');
covers.children(':not(:last)').hide();
setInterval(function() {
covers.children(':last')
.fadeOut(2500, function() { $(this).prependTo( covers ); })
.prev().fadeIn(2500);
}, 4000);
Link ku stránke:
http://erasmus.studenthosting.sk/Erasmus/index.php