PDA

Просмотр полной версии : Подскажите скрипт Title


navi1
07.01.2010, 23:30
:rolleyes: подскажите скрипт

чтоб менялся title в окне браузера

как здесь sintycat.ru

root_sashok
07.01.2010, 23:33
Смотри сорц. Потом задавай вопросы.

http://xmages.net/upload/b15ee31d.png

navi1
07.01.2010, 23:38
Смотри сорц. Потом задавай вопросы.

http://xmages.net/upload/b15ee31d.png


спасибо :rolleyes:
но я честно не нашел на этом сайте где там скрипт title

root_sashok
07.01.2010, 23:39
Тогда смотри сорц странички про которую сабж.

Вот он, если я не ошибаюсь:

<!--
/*
Animated Document title
Visit www.rainbow.arch.scriptmania.com for this script and more
*/

if (document.all||document.getElementById){
var thetitle=document.title
document.title=''
}

var data="абвагдеёжзийклмнопрстуфхц чшщэюяъь";
var done=1;

function statusIn(text){
decrypt(text,2,1);
}

function statusOut(){
self.status='';
done=1;
}

function decrypt(text, max, delay){

if (done){
done = 0;
decrypt_helper(text, max, delay, 0, max);
}
}

function decrypt_helper(text, runs_left, delay, charvar, max){

if (!done){
runs_left = runs_left - 1;
var status = text.substring(0,charvar);

for(var current_char = charvar; current_char < text.length; current_char++){
status += data.charAt(Math.round(Math.random()*data.length)) ;
}

document.title = status;
var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
var new_char = charvar + 1;
var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"

if(runs_left > 0){
setTimeout(rerun, delay);
}

else{

if (charvar < text.length){
setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1))+50);
}
else
{
done = 1;
}
}
}
}
//if IE 4+ or NS 6+
if (document.all||document.getElementById)
statusIn(thetitle)
//-->

navi1
08.01.2010, 07:44
Тогда смотри сорц странички про которую сабж.

Вот он, если я не ошибаюсь:

<!--
/*
Animated Document title
Visit www.rainbow.arch.scriptmania.com for this script and more
*/

if (document.all||document.getElementById){
var thetitle=document.title
document.title=''
}

var data="абвагдеёжзийклмнопрстуфхц чшщэюяъь";
var done=1;

function statusIn(text){
decrypt(text,2,1);
}

function statusOut(){
self.status='';
done=1;
}

function decrypt(text, max, delay){

if (done){
done = 0;
decrypt_helper(text, max, delay, 0, max);
}
}

function decrypt_helper(text, runs_left, delay, charvar, max){

if (!done){
runs_left = runs_left - 1;
var status = text.substring(0,charvar);

for(var current_char = charvar; current_char < text.length; current_char++){
status += data.charAt(Math.round(Math.random()*data.length)) ;
}

document.title = status;
var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
var new_char = charvar + 1;
var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"

if(runs_left > 0){
setTimeout(rerun, delay);
}

else{

if (charvar < text.length){
setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1))+50);
}
else
{
done = 1;
}
}
}
}
//if IE 4+ or NS 6+
if (document.all||document.getElementById)
statusIn(thetitle)
//-->






Действительно он :rolleyes:


спасибо :)