Teks berjalan di dalam form

Teks berjalan di dalam form menggunakan JavaScript, sudah saya rubah untuk Blogspot, jadi tinggal digunakan saja.




Demo :



Cara membuatnya

Penempatannya
dibawah <body>
........
diatas </body>


<div style="margin:0 auto;padding:0;">
<form name="marquee1">
<input name="text" size="50"
value=" Welcome to JK's ultimate JavaScript tutorial! Have fun!"
 />
</form>
</div>

<script type='text/javascript'>
//<![CDATA[

/*
Teks berjalan di dalam form by Dave Methvin dan
Publisher by JavaScript Kit http://www.javascriptkit.com/script/cut3.shtml
*/

ScrollSpeed = 300 //semakin besar semakin lambat
ScrollChars = 1 //jumlah huruf yang bergerak kesamping
function ScrollMarquee() {
window.setTimeout('ScrollMarquee()',ScrollSpeed);

var msg = document.marquee1.text.value;
document.marquee1.text.value =
msg.substring(ScrollChars) +
msg.substring(0,ScrollChars);
}
ScrollMarquee()

//]]>
</script>



Credit : JavaScript Kit

Alhamdulillah

0 comments:


Posting Komentar


Creative Commons License
Teks berjalan di dalam form by Nano Yulianto is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at http://nanoyulianto.blogspot.com/2011/01/teks-berjalan-di-dalam-form.html.
Permissions beyond the scope of this license may be available at http://nanoyulianto.blogspot.com/.