This article describes the method of implementing the DOM revolving lamp special effects in js. Share it for your reference. The specific implementation method is as follows:
The code copy is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Special effects of the revolving lantern</title>
<script type="text/javascript">
function scroll() {
// Assign the header file title to tit
var title = document.title;
//Get the first character of the title
var fir = tit.charAt(0);
//Get the remaining characters of the tit
var left = title.substring(1, title.length)
//Reassign the header file title to (the second character of the original title to the last character + the first character of the original title)
document.title = left + fir;
}
//Let scroll execute scroll() every 2000 milliseconds to achieve the effect of the revolving lantern
setInterval("scroll()", 2000);
</script>
</head>
<body>
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.