Post by Peter on Oct 27, 2004 10:11:39 GMT
This will fade in a div to let you know when you have new PM's...
Preview:
Headers
Preview:
<script language="JavaScript">
/*
© Patrick Clinger 2003
All Rights Reserved.
This script may ONLY be used on message boards
hosted by ProBoards.com. Any other site found
to be utilizing this code shall be in violation
of my copyright.
This copyright notice must remain in tact when
using this script.
*/
var IMtext = '000000'; // change this to be the color of the text you want in the box that appears
var IMbg = '00FFFF'; // change this to be the color of the background for the box that appears
var IMborder = '000000'; // change this to be the color of the border for the box that appears
var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
function findit() {
if(IE4)
if(window.document.body.createTextRange().text.match(/(\d+) are new./))
if(RegExp.$1 != 0)
newmessage(RegExp.$1);
if(window.document.body.createTextRange().text.match(/(\d+) is new./))
if(RegExp.$1 != 0)
newmessage(RegExp.$1);
if(NS4) {
if(!window.find("Welcome Guest.") && !window.find(", 0 are new."))
newmessage();
}
}
function newmessage(num) {
if(IE4) {
document.write('<span style="filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; id="imnew" style="position:absolute;top:100;width:100;height:100;" bgcolor="'+IMborder+'"><TABLE WIDTH="100" HEIGHT="100" CELLPADDING="0" CELLSPACING="1" BGCOLOR="'+IMborder+'"><TR><TD><TABLE WIDTH="100" HEIGHT="100" CELLPADDING="0" CELLSPACING="0"><TR><TD BGCOLOR="'+IMbg+'" ALIGN="CENTER"><a href="/?action=im"><FONT FACE="Verdana,Arial" SIZE="-1" COLOR="'+IMtext+'">You have <B>'+num+'</B> new message');
if(num != 1)
document.write('s');
document.write('!</A></font></TD></TR></TABLE></TD></TR></TABLE></span>')
imnew.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
fadeim(10,1);
imnew.style.left=document.body.clientWidth-105;
imnew.style.top=5;
setTimeout("fadeim(100,0)",4000);
}
if(NS4) {
newim = new Layer(100)
newim.left = document.width-105;
newim.top = 5
newim.document.write('<a href="/?action=im">You have a new instant message!</A>')
newim.document.close()
newim.visibility="show"
setTimeout('newim.visibility="hidden"',3000);
}
}
function fadeim(amount,direction) {
imnew.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+amount+")";
if(direction && amount < 100) {
setTimeout("fadeim("+(amount+10)+","+direction+")",100);
}
if(!direction) {
if(amount > 0)
setTimeout("fadeim("+(amount-10)+","+direction+")",100);
else
imnew.style.visibility='hidden';
}
}
findit();
</script>
Headers