JavaScript tips for making a happy lantern effect

Source: Internet
Author: User
Javascript| Tips

The following is the result of our production of the source program of the lantern effect

In this program we use the same function (or part) settimeout (...) as above. Notice that the timer goes to call the scroll () function in time to make the text in the marquee move forward into a grid. At the beginning of the function, there are some more verbose computations, but it's not hard to understand that these calculations are mainly used to get the use of the text in the marquee to be displayed by that position. The beginning of course is necessary to add some white space on the left side of the word, so that the text can be as far as possible to the right, and then a word will be blank reduction, the result of nature will cause the word forward movement effect.



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.