TELETYPE BANNER - ADB13


Flash banners are good for attracting attention and being extensively used in advertising field. Most of these are either from Google or from other ad marketing companies. For getting these codes, we have to depend on the third party plugins which is not at all good. Here, I have prepared the code which will be better to put in your blog/website without any plugin.
View the auto demo - ADB13 ( Also view the banner list here)

Each line appears in delay animation (3 Sec).
After all lines, pause for some period(3 Sec).
Auto refresh the banner(5 sec).
Simple and easy Javascript.

CSS CODE (in header):
textarea{border:#bbd9ef solid 1px; background:#f5fffa; padding: 5px; width: 275px; height: 115px; }
SCRIPT CODE (in header):
<script type="text/javascript"> var outMsg = ""; var i = 0; var lineNo = 1; var timerDM=null; var msg = " "; function araVob() { } var ScreenLine = new araVob(); ScreenLine[1] = "Design Banner in your own way." ScreenLine[2] = "Get more traffic and publishers."; ScreenLine[3] = "Still doubt, please do contact:" ScreenLine[4] = " "; ScreenLine[5] = "www.freemenu.info"; var msgNum = 1; // set to first message to display var msgCnt = 5; // set to number of last message "page" to display. var typeSpeed = 200; // the typing rate, in milliseconds. (Higher number is slower) var pageLen = 5; // set to page size, usually number of ROWS in TEXTAREA var delay=typeSpeed; var r = 0; var cr="\r\n" if ("3" <=navigator.appVersion.charAt(0)) { var cr="\n" } for (x = 1; x<=(msgCnt); x++) { ScreenLine[x] = ScreenLine[x] + cr; } msg = ScreenLine[1]; function DisplayMsg() { if (msg.length <= i || msg.charAt(i) == "\f") { r=i; i=0; ChangeMsg(); } outMsg = outMsg + msg.charAt(i); i++; if (msg.charAt(i) == "\f" || (lineNo == pageLen && i==msg.length)) { delay = 4000; } else { if (msg.charAt(i) == cr && msg != " "+cr) { delay = 2000; } else { delay = typeSpeed; } } self.document.forms[0].elements[0].value=outMsg; timerDM = setTimeout("DisplayMsg()",delay); } function ChangeMsg() { msgNum++; if (msgCnt < msgNum) { msgNum = 1; } lineNo++; if (pageLen < lineNo || msg.charAt(r) == "\f") { outMsg=ScreenLine[msgNum].charAt(i); i++; lineNo = 1; } msg = ScreenLine[msgNum]; } </script>
HTML CODE (in body):
<body onLoad="DisplayMsg()"; onUnload="quitDisplay()"> <form> <textarea> wait please. </textarea> </form> </body>

No comments:

Click Here To add Comment

Post a Comment