This article uses several ultra-simple codes to implement title scrolling. For more information, see the reference.
The Code is as follows:
The Code is as follows: |
Copy code |
(Function (){ Var titleScroll = function (){ Var index = 0; Var text = "welcome to the Story campus album! "; Var len = text. length; Var init = function (){ Document. title = text. substring (0, index + 1 ); Index ++; If (index> = len ){ Index = 0; Document. title = text; } SetTimeout (arguments. callee, 150 ); } Init (); } TitleScroll (); ("Http://www.bKjia. c0m ") |
Of course, there is a compressed version. The usage should be changed to your prompt text in the variable passed in the final brackets.
The Code is as follows: |
Copy code |
(Function (B) {var a = 0, c = B. length; (function () {document. title = B. substring (0, a + 1); a ++; a> = c & (a = 0, document. title = B); setTimeout (arguments. callee, 150)}) ()} ("http://www.bKjia. c0m ");
|