Quote:
|
Originally Posted by SmokeyTheBear
heres a simple text or image banner rotation
Code:
<!----Main Banner Rotation--------
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) hahahaha 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else {
if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else {
if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
}
}
var winl = (myWidth - 624) / 2;
var wint = (myHeight - 600) / 2;
n=new Date();
//j=n.getSeconds();
m=n.getMilliseconds();
t=n.getSeconds();
b=m*.001;
j=t+b;
if (j<20.3) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<40.1) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else if (j<59.9) document.write("<center><a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.com/ban.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
else document.write("<center><a href=\"http://www.defaultlink.com\" target=\"_blank\"><img src=\"http://yoursite.com/big.gif\" alt=\"your alt text\" height=80 width=624 border=0></a>\n");
//----Banner Rotation-----End Hide from inferior browsers----->
|
Thanks a bunch for your help!