My project 5 timer JS achieves image motion, Timer js

Source: Internet
Author: User

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 )';

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.