Тема: Rollover image
Показать сообщение отдельно
Старый 16.01.2002, 14:30
джагги на работе вне форума Посмотреть профиль Отправить личное сообщение для джагги на работе Посетить домашнюю страницу джагги на работе Найти все сообщения от джагги на работе
  № 11  
джагги на работе
 
Аватар для джагги на работе

Регистрация: Nov 2001
Адрес: Мальенькая психиатрическая больница
Сообщений: 410
Отправить сообщение для джагги на работе с помощью ICQ
вОТ ЧТО МОНА ВСТАВИТЬ
<html>
<head>
<title>Preload Image Page</title>

<script language="JavaScript1.1">
<!-- begin hiding
var locationAfterPreload = "http://dynamicdrive.com" // URL of the page after preload finishes
var lengthOfPreloadBar = 150 // Length of preload bar (in pixels)
var heightOfPreloadBar = 15 // Height of preload bar (in pixels)
// Put the URLs of images that you want to preload below (as many as you want)
var yourImages = new Array("http://www.yourdomain.com/test1.gif","http://www.yourdomain.com/test2.gif","http://www.yourdomain.com/test3.gif","http://www.yourdomain.com/test4.gif","http://www.yourdomain.com/test5.gif")

// Do not modify anything beyond this point!
if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = "black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
dots[1] = new Image(1,1)
dots[1].src = "blue.gif" // color of bar as preloading progresses (same note as above)
var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
var loaded = new Array(),i,covered,timerID
var leftOverWidth = lengthOfPreloadBar%coverage
}
function loadImages() {
for (i = 0; i < yourImages.length; i++) {
preImages[i] = new Image()
preImages[i].src = yourImages[i]
}
for (i = 0; i < preImages.length; i++) {
loaded[i] = false
}
checkLoad()
}
function checkLoad() {
if (currCount == preImages.length) {
location.replace(locationAfterPreload)
return
}
for (i = 0; i <= preImages.length; i++) {
if (loaded[i] == false && preImages[i].complete) {
loaded[i] = true
eval("document.img" + currCount + ".src=dots[1].src")
currCount++
}
}
timerID = setTimeout("checkLoad()",10)
}
// end hiding -->
</script>

</head>

<body bgcolor="#FFFFFF">

<center>
<font size="4">иДЕТ ЗАГРУЗКА</font><p>
0%
<script language="JavaScript1.1">
<!-- begin hiding
if (document.images) {
var preloadBar = ''
for (i = 0; i < yourImages.length-1; i++) {
preloadBar += '<img src="' + dots[0].src + '" width="' + coverage + '" height="' + heightOfPreloadBar + '" name="img' + i + '" align="absmiddle">'
}
preloadBar += '<img src="' + dots[0].src + '" width="' + (leftOverWidth+coverage) + '" height="' + heightOfPreloadBar + '" name="img' + (yourImages.length-1) + '" align="absmiddle">'
document.write(preloadBar)
loadImages()
}
document.write('<p><small><a href="javascript:window.location=locationAfterPreload">Пропустить</a> &nbsp;| &nbsp;<a href="http://www.alesh.net">ALESH.NET</a></small></p>')
// end hiding -->
</script>
</center>

</body>
</html>
__________________
Работы меняются, Джагги остается
-----
Утопился из водяного пистолета.