实现了一行文字循环从浏览器右边滚动到左边
<body οnlοad="showmsg()">
<div id="myshowmsg" style="position: absolute; left: -180px; width: 200px; color: lightcoral" >
welcome to this page!!!
</div>
<script>
var num;
var msg = document.getElementById("myshowmsg");
function showmsg(){
if(parseInt(document.getElementById("myshowmsg").style.left)<=-120){
msg.style.left = window.innerWidth+"px";
}
msg.style.left = (parseInt(msg.offsetLeft)-10)+"px";
num = setTimeout("showmsg()",100);
}
</body>