Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Hiển thị khung chữ
URL: https://www.javascriptbank.com/textticker-with-random-blender.html
Thông tin trong hộp thoại được hiển thị sau khi nền của hộp thoại được kéo sang phải rồi cuộn sang trái.
Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Hiển thị khung chữ
URL: https://www.javascriptbank.com/textticker-with-random-blender.html
<SCRIPT><!-- Beginning of JavaScript -// pause between the messages (microseconds)var waitabit=2000// numbers of transmissionblendersvar spannumber=20// borderwidth of messageboxvar borderwidth=4// bordercolor of messageboxvar bordercolor="880000"// width and height of the messagebox (pixels)var boardwidth=120var boardheight=120// backgroundcolor of messageboxvar bgcolor="FF0000"// fontfamily, fontsize, fontcolor, fontweightvar thisfontfamily="Verdana"var thisfontcolor="FFFFFF"var thisfontsize="11"var thisfontweight="bold"// distance to left side of browermargin (pixels)var xscreenmargin=10// distance to top of of browsermargin (pixels)var yscreenmargin=20// messagesvar message=new Array()message[0]="To tell you the truth I have no idea why you should read this messages!"message[1]="In fact it would be much wiser to go fishing or gardening or cooking or flirting."message[2]="Instead you are staring at your screen, ruining your eyes and boring your friends."message[3]="Why?"message[4]="Just because you want to find out the silly source code behind this silly ticker."message[5]="Do you call this life?"message[6]="I'm afraid you are as addicted to JavaScript and DHTML as I am."message[7]="And I'm afraid there is no cure for this insidious addiction."message[8]="You are lost, pity you!"// colors transmission blendersvar col=new Array()col[0]="111111"col[1]="222222"col[2]="333333"col[3]="444444"col[4]="555555"col[5]="666666"col[6]="777777"col[7]="888888"col[8]="999999"col[9]="AAAAAA"col[10]="BBBBBB"col[11]="CCCCCC"col[12]="DDDDDD"col[13]="EEEEEE"// various variables. No need to change them.var i_span=0var i_maxspan=50var i_message=0var timervar randfunction randommaker(range) {rand=Math.ceil(range*Math.random()) return rand}function showimages() { if (i_span <= spannumber-1) { var thisspan = eval("document.all.span"+i_span+".style") thisspan.visibility="VISIBLE"thisspan.backgroundColor=col[randommaker(col.length-1)] timer=setTimeout("showimages()",20) i_span++ } else { i_span-- clearTimeout(timer) mesdiv.innerHTML="<span style='position:absolute;top:10px'>"+message[i_message]+"</span>" i_message++ if (i_message>=message.length) {i_message=0} timer=setTimeout("hideimages()",20) }}function hideimages() { if (i_span >= 0) { var thisspan = eval("document.all.span"+i_span+".style") thisspan.visibility="HIDDEN" timer=setTimeout("hideimages()",1) i_span-- } else { clearTimeout(timer) i_span=0 timer=setTimeout("showimages()",waitabit) }}document.write('<body bgcolor=#FFFFFF>')document.write("<div id='mesdiv' style='position:absolute;top:"+yscreenmargin+"px;left:"+xscreenmargin+"px; width:"+boardwidth+"px;height:"+boardheight+"px;background-color:"+bgcolor+";overflow:hidden;text-align:left;font-family:"+thisfontfamily+";font-size:"+thisfontsize+";font-weight:"+thisfontweight+";color:"+thisfontcolor+"'></div>")document.write("<div id='maindiv' style='position:absolute;top:"+(yscreenmargin-borderwidth)+"px;left:"+(xscreenmargin-borderwidth)+"px; width:"+(boardwidth+2*borderwidth)+"px;height:"+(boardheight+borderwidth)+"px;overflow:hidden;border-color:"+bordercolor+";border-style:groove;border-width:"+borderwidth+"px'>")for (i=0;i<=spannumber;i++) {var spanwidth=Math.ceil((boardwidth-borderwidth)/spannumber)var spanleft=Math.ceil(i*((boardwidth-borderwidth)/spannumber)) document.write("<span id='span"+i+"' style='position:absolute;left:"+spanleft+"px;width:"+spanwidth+"px;height:"+(boardheight-borderwidth)+"px;visibility:hidden'>") document.write("</span>") }document.write("</div>")showimages()// - End of JavaScript - --></SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->