Уведомление о новом сообщении
Код:
forum = "http://scripts.mybb.ru"
str = document.getElementById("navpm").innerHTML
loc = new String(document.location)
if( (str.indexOf("(") != -1) &&
loc.indexOf('messages.php')==-1)
{
count = parseInt(str.substring(str.indexOf("(")+1,str.indexOf(")")))
if (count==1) text="У вас есть 1 новое сообщение"
else if (count>1 && count<5) text="У вас есть " +count+" новых сообщения"
else text="У вас есть " +count+" новых сообщений"
msg = "<div id=\"new-mes\" class=\"container\" style=\"position: absolute; z-index=2; left: 40%;\">"
msg += text
msg += "<br><a href=\"\" onclick=\"document.location.replace('messages.php'); document.getElementById('new-mes').style.display='none';return false;\">Посмотреть личные сообщения</a>"
msg +="<br><a href=\"\" onclick=\"document.getElementById('new-mes').style.display='none'; return false\">Закрыть окно</a>\r\n"
msg += "</div>"
document.getElementById("pun-status").innerHTML += msg
}
</script>Запили в htlm (вроде в верхний) если не прокатит то в нижний :о
Мне росто делать нечего.
Постепенно набирается название форума.
Код:
<script>
var tit = document.title;
var c = 0;
function writetitle() {
document.title = tit.substring(0,c);
if(c==tit.length) {
c = 0;setTimeout("writetitle()", 3000)
} else {
c++;
setTimeout("writetitle()", 200)
}
}
writetitle()
</script>Тоже или в верх или в низ.
