»
EnglishFrenchVietnamese

Print - JavaScript Ticker 1.1 - JavaScriptBank.com

Full version: jsB@nk » Form » Dropdown » JavaScript Ticker 1.1
URL: https://www.javascriptbank.com/javascript-ticker-11.html

JavaScript Ticker 1.1 © JavaScriptBank.comThe code creates ticker messages in a frame.

Full version: jsB@nk » Form » Dropdown » JavaScript Ticker 1.1
URL: https://www.javascriptbank.com/javascript-ticker-11.html



HTML
<SCRIPT language=javascript><!--////************************************************//* JavScript Ticker Script 1.1                  *//* Added status bar scrolling message           *//* (c) Premshree Pillai                         *//* Use freely as long as this message is intact *//* E-mail : premshree@hotmail.com               *//************************************************// Use the scipt preferably in a frame, since it refreshes automatically// after it has displayed all the messages.document.write('<form name="ticker_form">');document.write('<table border="1"><tr>');document.write('<td><font face="arial,verdana,helvetica" size="-2" color="#000000">Ticker News :</font><br>');document.write('<input type="button" name="ticker_space" onClick="navigate()" style="height:20; background-color:#D7CFC0; border-color:#000000; border-width:1; width:300; cursor:hand"></td>');document.write('<td><font face="arial,verdana,helvetica" size="-2" color="#000000">Change Speed :</font><br>');document.write('<select name="select_speed" onChange="ChangeScrollSpeed();">');document.write('<option name="1" value="1">1</option>');document.write('<option name="2" value="2" selected>2</option>');document.write('<option name="3" value="3">3</option>');document.write('<option name="4" value="4">4</option>');document.write('<option name="5" value="5">5</option>');document.write('</select></td></tr></table>');document.write('</form>');//Message Arrayvar TickerValList = new Array("Welcome to JavaScriptBank.com","Bank of free JavaScript","DHTML","CSS","Example Code");//Message URL arrayvar TickerListURL = new Array("http://qik.cjb.net","http://intellisearch.cjb.net","http://dezigns.qik.cjb.net","http://aboutQiksearch","mailto:premshree@hotmail.com");var ticker_speed = this.document.ticker_form.select_speed.value;var i=0;var pos=0;var spacer="...        ...";var msg;//Function that writes the valuesfunction ChangeTickerVal(i){if(i<TickerValList.length)   {    this.document.ticker_form.ticker_space.value = TickerValList[i];   }if(i==TickerValList.length)   {    location.reload();   }msg = TickerValList[i];delay();}//delay functionfunction delay(){i++;setTimeout("ChangeTickerVal(i)",ticker_speed*1000);}//URL navigation functionfunction navigate(){location.href = TickerListURL[i-1]}//Function to change scroll speed//Effect will be visible if there are many vals in the ticker function ChangeScrollSpeed(){ticker_speed = this.document.ticker_form.select_speed.value;setTimeout("ChangeTickerVal(i)",ticker_speed*1000);}//status bar scrolling functionfunction ScrollMessage(){ window.status = msg.substring(pos, msg.length) + spacer + msg.substring(0, pos); pos++; if (pos > msg.length) pos=0; window.setTimeout("ScrollMessage()",100);}ChangeTickerVal(i);ScrollMessage();//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->