arsen
НЕрядовой
- Регистрация
- 16 Июн 2011
- Сообщения
- 1.079
- Реакции
- 356
- Автор темы
- #1
Код:
<img src="" alt="background" id="bg" style="display:none" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" class="noprint">
var aImages = new Array();
var aURL = new Array();
var aArtists = new Array();
var iPrev = -1;
var iRnd = -1;
aImages[0] = "templates/_default_/images/bg/bg.jpg";
aImages[1] = "templates/_default_/images/bg/bg1.jpg";
aImages[2] = "templates/_default_/images/bg/bg2.jpg";
aImages[3] = "templates/_default_/images/bg/bg3.jpg";
$(document).ready(function() {
$("img#bg").load(function()
{
$("img#bg").fadeTo(2000,1);
setTimeout(function()
{
$("#image_description").animate({right: '-=150'}, 1000);
$("img#bg").fadeOut(2000);
setTimeout(LoadImages,2500);
}
,30000);
}
)
setTimeout(LoadImages,1000);
});
function LoadImage(iNr)
{
$("img#bg").attr("src", aImages[iNr]);
};
function LoadImages()
{
/* Select a random image number and make sure this is not equal to the previous image */
while(iPrev == iRnd)
{
iRnd = Math.floor(Math.random()*aImages.length);
}
/* Show the selected image */
LoadImage(iRnd);
iPrev = iRnd;
};
</script>