Witajcie. Kompletnie nie znam się na js. Chciałem, aby na stronie co jakiś czas zmieniał się obiekt flash. Znalazłem taki kod, ale do obrazków. W kodzie źródłowym zmienia się adres obiektu, ale wizualnie tego nie widać. Chciłabym, aby przejście z 1 obiektu na 2 było płynne (np. jakieś animowane przejście do czerni).
Bardzo proszę o pomoc.
var delay=100
var curindex=0
var randomimages=new Array()
randomimages[0]="1.swf"
randomimages[1]="2.swf"
randomimages[2]="3.swf"
randomimages[3]="4.swf"
randomimages[4]="5.swf"
randomimages[5]="6.swf"
var preload=new Array()
for (n=0;n<randomimages.length;n++)
{
preload[n]=new Image()
preload[n].src=randomimages[n]
}
document.write('<embed name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'" width=1050 height=250px ></embed>')
function rotateimage()
{
if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
curindex=curindex==0? 1 : curindex-1
}
else
curindex=tempindex
document.defaultimage.src=randomimages[curindex]
}
setInterval("rotateimage()",delay)
$(document).ready(function() {
setInterval(function() {
$.ajax({
url: 'testhtml.html',
dataType: 'text'
});
}, 100);
});