My project 5 timer JS achieves image motion, Timer js
After using a timer in an HTML5 project, I learned how to share my experience with you.
A method is required:
setInterval("ballMove()", 1000);
This means that the ballMove () method is executed once per second.
Where can he use it? This requires the imagination of our friends. Here I use it to write an example of Free Image shipping.
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
So what about the image I drew using Canvas? I want to draw the path through it.
<! DOCTYPE html> You can give it a try.
51 Single-Chip Microcomputer uses assembly programming to use the timer 0, and uses the Timer/Counter T0 interrupt method to set the timer for 05 seconds, so that 8 flow lights are lit in turn, each lamp is lit for 05 seconds
The changes are as follows:
......
INT_SUB:
MOV TH0, # 3CH; reset the initial value for the Timer/Counter
MOV TL0, # 0B0H
DJNZ R7, LOOP; judge whether the number of time records is sufficient, 50 milliseconds at a time, a total of ten times
RL
MOV P1,
MOV R7, #10; re-assign a value to the number of time cycles
LOOP:
RETI
END
This is fine.
Use the js timer to switch the background image. For details, refer to the following code: js
You set a 2.jpg image for the background image and then switch to another image.
Changed to OS. backgroundImage = 'url ('+ (parseInt (Math. random () * 10) + 1100000000'.jpg )';