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

In - Khung cuộn tin - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Scrollers » Khung cuộn tin
URL: https://www.javascriptbank.com/news-scroller-v22.html

Khung cuộn tin © JavaScriptBank.comHiệu ứng tạo một dòng chữ di chuyển trong khung từ phải sang trái, ta có thể điều chỉnh tốc độ di chuyển này bằng các nút tương ứng.

Phiên bản đầy đủ: jsB@nk » Scrollers » Khung cuộn tin
URL: https://www.javascriptbank.com/news-scroller-v22.html



CSS
<STYLE type=text/css>A:link {COLOR: blue}A:visited {COLOR: blue}A:hover {COLOR: red}.tabc {COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 12px; FONT-WEIGHT: bold; TEXT-ALIGN: center}.tabt {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 18px; FONT-WEIGHT: bold; TEXT-ALIGN: center}.tabb {FONT-FAMILY: Arial; FONT-SIZE: 14px; FONT-WEIGHT: bold}</STYLE><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<SCRIPT language=JavaScript>var swidth=370;var sheight=20;var sbcolor="#ccffcc";var sspeed=10;var restart=sspeed;wholemessage=wholemessage='<nobr class=tabc>JSBank.com - The home of free scripts</nobr>';var sizeup=0;var operbr=navigator.userAgent.toLowerCase().indexOf('opera');function goup(){if(sspeed==2){sspeed=4;restart=sspeed;}else if(sspeed==4){sspeed=8;restart=sspeed;}else if(sspeed==8){sspeed=16;restart=sspeed;}}function godown(){if(sspeed==16){sspeed=8;restart=sspeed;}else if(sspeed==8){sspeed=4;restart=sspeed;}else if(sspeed==4){sspeed=2;restart=sspeed;}}function start(){if (document.all) iemarquee(slider);else if(document.getElementById)ns6marquee(document.getElementById('slider'));else if(document.layers)ns4marquee(document.slider1.document.slider2);}function iemarquee(whichdiv){iediv=eval(whichdiv);iediv.style.pixelLeft=swidth;iediv.innerHTML='<nobr>'+wholemessage+'</nobr>';sizeup=iediv.offsetWidth;if(operbr!=-1){operaslider.innerHTML='<nobr>'+wholemessage+'</nobr>';sizeup=operaslider.offsetWidth;}ieslide();}function ieslide(){if (iediv.style.pixelLeft>=sizeup*(-1)){iediv.style.pixelLeft-=sspeed;setTimeout("ieslide()",100);}else{iediv.style.pixelLeft=swidth;ieslide();}}function ns4marquee(whichlayer){ns4layer=eval(whichlayer);ns4layer.left=swidth;ns4layer.document.write('<nobr>'+wholemessage+'</nobr>');ns4layer.document.close();sizeup=ns4layer.document.width;ns4slide();}function ns4slide(){if(ns4layer.left>=sizeup*(-1)){ns4layer.left-=sspeed;setTimeout("ns4slide()",100);}else{ns4layer.left=swidth;ns4slide();}}function ns6marquee(whichdiv){ns6div=eval(whichdiv);ns6div.style.left=swidth;ns6div.innerHTML='<nobr>'+wholemessage+'</nobr>';sizeup=ns6div.offsetWidth;ns6slide();}function ns6slide(){if(parseInt(ns6div.style.left)>=sizeup*(-1)){ns6div.style.left=parseInt(ns6div.style.left)-sspeed;setTimeout("ns6slide()",100);}else{ns6div.style.left=swidth;ns6slide();}}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=start();><DIV align=center class=tabc>Cross-Browser DHTML JavaScript: IE4+, OPERA 7+, NS4+, NS6+, MOZILLA. <DIV align=center class=tabc>Slides a message from the right to the left. Adjustable: SIZE, <DIV align=center class=tabc>BACKGROUND and SPEED (LIVE too). Pauses with mouse over. <DIV align=center class=tabc>Allows the use of any basic HTML code.</DIV></DIV></DIV></DIV><TABLE align=center border=2>  <TBODY>  <TR>    <TD bgColor=#ffffcc>      <DIV class=tabc><B><U><A class=tabb       href="http://jsbank.topcities.com"       onclick=goup();>UP </A></U>-<U><A class=tabb       href="http://jsbank.topcities.com"       onclick=godown();> DN</A></U></B></DIV></TD>    <TD width=370>      <SCRIPT language=JavaScript>if(document.getElementById || document.all){document.write('<span style="width:'+swidth+';"><div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);background-color:'+sbcolor+';" onMouseover="sspeed=0;" onMouseout="sspeed=restart">');if(operbr!=-1)document.write('<div id="operaslider" style="position:absolute;visibility:hidden;"></div>');document.write('<div id="slider" style="position:relative;height:'+sheight+';"></div></div></span>')}</SCRIPT>      <ILAYER bgcolor="&amp;{sbcolor};" name="slider1" height="&amp;{sheight};"       width="&amp;{swidth};"><LAYER onmouseout=sspeed=restart       onmouseover=sspeed=0; name="slider2" height="&amp;{sheight};"       width="&amp;{swidth};"></LAYER></ILAYER></TD></TR></TBODY></TABLE><SCRIPT language=JavaScript>function ctrlA0(corp) {with(corp){focus(); select()}if(document.all){txt=corp.createTextRange()txt.execCommand("Copy")window.status='Text copied to clipboard'}else window.status='Press ctrl-c to copy the text to the clipboard'setTimeout("window.status=''",10000)}</SCRIPT></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->