Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ chạy từ phải sang trái
URL: https://www.javascriptbank.com/simple-wholewidthticker-scrolling-from-right-to-left.html
Hiệu ứng tạo một liên kết ở phía trên trang web di chuyển theo chiều từ phải sang trái.
Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ chạy từ phải sang trái
URL: https://www.javascriptbank.com/simple-wholewidthticker-scrolling-from-right-to-left.html
<SCRIPT language=JavaScript><!-- Beginning of JavaScript -// WholeWidthTicker// Edit the variables below:// Your messages. Add as many as you likevar message=new Array()message[0]="JavaScriptBank.com - Bank of over 2000+ free JavaScripts"// the URLs of your messagesvar messageurl=new Array()messageurl[0]="http://JavaScriptBank.com"// the targets of the links// accepted values are '_blank' or '_top' or '_parent' or '_self'// or the name of your target-window (for instance 'main')var messagetarget=new Array()messagetarget[0]="_blank"messagetarget[1]="_blank"messagetarget[2]="_blank"// distance of the ticker to the top margin of the browser-window (pixels)var postop=0// speed 1: lower means fastervar pause=20// speed 2: higher means fastervar step=5// font-sizevar fntsize=25// font-colorvar fntcolor="66AA22"// font-familyvar fntfamily="Verdana"// font-weight: 1 means bold, 0 means normalvar fntweight=1// do not edit the variables belowvar i_message=0var timervar textwidthvar textcontent=""if (fntweight==1) {fntweight="700"}else {fntweight="100"}function init() {gettextcontent() if (document.all) {screenwidth=document.body.clientWidthtext.innerHTML=textcontentdocument.all.text.style.posTop=postop document.all.text.style.posLeft=screenwidthtextwidth=text.offsetWidth scrolltext() }if (document.layers) {screenwidth=window.innerWidthdocument.text.document.write(textcontent)document.text.document.close()document.text.top=postopdocument.text.left=screenwidthtextwidth=document.text.document.width scrolltext() }}function scrolltext() { if (document.all) {if (document.all.text.style.posLeft>=textwidth*(-1)) {document.all.text.style.posLeft-=stepvar timer=setTimeout("scrolltext()",pause)}else {changetext()}} if (document.layers) {if (document.text.left>=textwidth*(-1)) {document.text.left-=stepvar timer=setTimeout("scrolltext()",pause)}else {changetext()}}}function changetext() { i_message++if (i_message>message.length-1) {i_message=0}gettextcontent()if (document.all) {text.innerHTML=textcontent document.all.text.style.posLeft=screenwidthtextwidth=text.offsetWidth scrolltext()}if (document.layers) { document.text.document.write(textcontent)document.text.document.close()document.text.left=screenwidthtextwidth=document.text.document.width scrolltext()}}function gettextcontent() {textcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"textcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+">"textcontent+="<nobr><font color="+fntcolor+">"+message[i_message]+"</font></nobr></a></span>"}window.onresize=init;// - End of JavaScript - --></SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<BODY onload=init()><DIV id=text style="LEFT: -2000px; POSITION: absolute"></DIV></BODY><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->