Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ di chuyển
URL: https://www.javascriptbank.com/animated-text-script.html
Một đoạn mã JavaScript khác để tạo chữ di chuyển trong trang web.
Phiên bản đầy đủ: jsB@nk » Chữ » Hoạt hóa » Chữ di chuyển
URL: https://www.javascriptbank.com/animated-text-script.html
<style type="text/css"><!--#mover {position: absolute; left: 5px; top: 5px; font-size:36px}--></style><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<script type="text/javascript" language="Javascript"><!-- Hide script from older browsersfirstTime = trueif (document.getElementById) {stdBrowser = true}else {stdBrowser = false}function moveIt() {if (firstTime) {if (stdBrowser) {moverObj = document.getElementById("mover").stylemoverObj.top = "5px"moverObj.left = "5px"}if (document.all) {maxWidth = document.body.clientWidth-300}else {maxWidth = window.innerWidth-300}firstTime = false}if (stdBrowser) {topPos = parseInt(moverObj.top) + 2leftPos = parseInt(moverObj.left) + 2moverObj.top = topPos + "px"moverObj.left = leftPos + "px"}else {document.mover.top += 2document.mover.left += 2leftPos = document.mover.left}if (leftPos < maxWidth) {setTimeout("moveIt()",20)}}// End hiding script --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<body onload="moveIt()"><div id="mover">On the road again...</div></body><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->