This article illustrates the method of realizing Dom Merry-go effect by JS. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title> merry-go Special Effects </title>
<script type= "Text/javascript" >
function Scroll () {
Assign header file headers to tit
var tit = document.title;
Gets the first character of the tit
var fir = Tit.charat (0);
Get tit the remaining characters
var left = tit.substring (1, tit.length)
Re-assign header file headers (the second character of the original title to the last character + the first character of the original object)
Document.title = left + fir;
}
Let scroll perform scroll () once every 2000 milliseconds to achieve merry-go effect
SetInterval ("Scroll ()", 2000);
</script>
<body>
</body>
I hope this article will help you with your JavaScript programming.