»
Tiếng AnhTiếng PhápTiếng Việt

In - Chữ chong chóng - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ chong chóng
URL: https://www.javascriptbank.com/textrotor-rotate-your-messages-around-the-page.html

Chữ chong chóng © JavaScriptBank.comHiệu ứng tạo ra một dòng chữ tự quay như một chong chóng trên trang web.

Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ chong chóng
URL: https://www.javascriptbank.com/textrotor-rotate-your-messages-around-the-page.html



JavaScript
<SCRIPT><!-- Beginning of JavaScript -// the width of your TextRotor (see variable 'scrollerwidth' below messages)var message = new Array()message[0]="JavaScriptBank.com!"message[1]="JavaScriptBank.com!"message[2]="JavaScriptBank.com!"message[3]="JavaScriptBank.com!"message[4]="JavaScriptBank.com!"// Width an height of your TextRotor (pixels).var scrollerheight=200var scrollerwidth=700// Fontvar font_family="Arial"// The horizontal and vertical position of your TextRotor. This is quite tricky.// You will see why when you try different values.var x_textposition=0var y_textposition=0// Do not edit the variables belowvar i_message=0var i_loop=0var max_loop=48var timery_textposition=y_textposition-Math.floor(scrollerheight/1.5)+10x_textposition=x_textposition-Math.floor(scrollerwidth/3)function initiate() {if (document.all) {document.all.rotationstyle.style.posLeft=x_textpositiondocument.all.rotationstyle.style.posTop=y_textposition        changemessage()}}function changemessage() {do_rotate="yes"rotationstyle.innerHTML='<OBJECT ID="rotationobj" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="left:300;top:250; position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+        '<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+        '<PARAM NAME="Line0002" VALUE="SetLineColor(255,0,0)">'+'<PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0)">'+'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+5+', 400, 0, 0, 0)">'+'<PARAM NAME="Line0005" VALUE="Text(\''+message[i_message]+'\', 0, 0, 0)">'+'</OBJECT>'startscroll()}function startscroll() {if (i_loop < max_loop) {        rotationobj.Rotate(0,0,-30) rotationobj.Scale(1.04,1.04,1.04)i_loop++timer=setTimeout("startscroll()",50)}   else {        i_message++i_loop=0        if (i_message>=message.length) {i_message=0}timer=setTimeout("changemessage()",2000)}}// - End of JavaScript - --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=initiate()><SPAN id=rotationstyle style="POSITION: absolute;"><OBJECT classid=CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6 id=rotationobj></OBJECT></SPAN></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->