Create site free
PSP Portal. Сайт для PSP! - Форум
Главная | Регистрация | Вход Приветствую Вас зарегистрироваться | RSS



Введите название игры или фразу для поиска.

[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
Страница 1 из 11
Форум » Общее » Для владельцев сайтов » Скрипт загрузски страницы
Скрипт загрузски страницы
SuNRiZEДата: Среда, 04.06.2008, 12:17 | Сообщение # 1
Одмин
Группа: Администраторы
Сообщений: 364
Статус: Offline


источник  forum.ucoz.ru

1) это между тэгами <head></head>




Code


<script type="text/javascript">   

function hideLoading() {   

document.getElementById('pageIsLoading').style. display = 'none';   

}   

</script>




2) это сразу после тэга <body>




Code


<div id="pageIsLoading"   

style="   

position: absolute;   

display: block;   

padding-left: 44px;   

padding-right: 12px;   

width: auto;   

height: 46px;   

line-height: 46px;   

border: 1px solid #890000;   

color: #000000;   

font-weight: bold;   

background-color: #e5e5e5;   

background-image: url(http:// URL КАРТИНКИ! );   

background-position: 6px center;   

background-repeat: no-repeat;">   

<script type="text/javascript">   

if (typeof window_width == 'undefined' || typeof window_height == 'undefined')
{   

var window_width;   

var window_height;   

if( typeof( window.innerWidth ) == 'number' ) {   

window_width = window.innerWidth;   

window_height = window.innerHeight;   

} else if( document.documentElement &&   

( document.documentElement.clientWidth ||
document.documentElement.clientHeight ) ) {   

window_width = document.documentElement.clientWidth;   

window_height = document.documentElement.clientHeight;   

} else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {   

window_width = document.body.clientWidth;   

window_height = document.body.clientHeight;   

}   

}   

var left = Math.round((window_width - 200) / 2);   

var top = Math.round(((window_height - 46) / 3) + 46);   

document.getElementById('pageIsLoading').style.l eft = left+'px';   

document.getElementById('pageIsLoading').style.t op = top+'px';   

</script>   

Загружается... Ждите...   

</div>




3) Это перед </body> (в самом конце)





Code


<script type="text/javascript">   

if (window.addEventListener) {   

window.addEventListener('load', hideLoading, false);   

} else if (window.attachEvent) {   

var r = window.attachEvent("onload", hideLoading);   

} else {   

hideLoading();   

}   

</script>



Добавлено (14.04.2008, 19:26)

---------------------------------------------

вот пример:



Не ГоВоРи ЧтО мНе НаДо ДеЛаТь И я Не СкАжУ кУдА тЕбЕ нАдО иДтИ



 
Форум » Общее » Для владельцев сайтов » Скрипт загрузски страницы
Страница 1 из 11
Поиск:
Новый ответ
Имя:
Текст сообщения:
Опции сообщения:
Код безопасности:

Сайт создан и управляется SxxxS.
PsP Portal © 2012
Создать сайт бесплатно