Templi. onmouseover = Function (){ This . Style. backgroundcolor = "# fff68f" ; VaR Tempfun = This . Previussibling; While (Tempfun! = Null ) {Tempfun. style. backgroundcolor = "Fff5d2" ; Tempfun =Tempfun. previussibling;} tempfun = This . Nextsibling; While (Tempfun! = Null ) {Tempfun. style. backgroundcolor = "Fff5d2" ; Tempfun = Tempfun. nextsibling ;}};
2. Execute a method repeatedly in JS setTimeout.
/* Count: Number of start points
Call method: scripttest (0)
Result: hello11 times
*/
Function scripttest (count) {If (count <10) {count ++; // auto-increment alert ("hello"); // setTimeout (function () {scripttest (count) ;}, 1000); // self-called }}
// When you move the room, you do not have to order it again or again.
/* FUNC: function name time: number of executions */function scripttest (count) {If (count <20) {// total number of times count ++; // auto-increment // alert ("hello"); setposition (count); // main function body setTimeout (function () {scripttest (count) ;}, 1000 ); // self-called }}