JavaScript@Workshop 
HOME > JavaScript サンプル集 > テキストをスクロールする
テキストをスクロールする

サンプルソース

<html>
<body onload="scroll()">

<script language="Javascript">
<!--
msg="ここにメッセージを入れてください。テキストボックスでスクロールします。";

function scroll() {
    msg=msg.substring(1,msg.length) + msg.substring(0,1);
    document.all.txt1.value=msg;
    setTimeout("scroll()",300);
}
-->
</script>

<input type="text" id=txt1 size=60>

</body>
</html>

解説

setTimeout・・・関数をミリ秒単位に実行する

サンプル

関連する内容



スポンサードリンク



Copyright (C) 2006-2008 JavaScript@Workshop All rights reserved.