JavaScript to achieve the countdown effect of the method (desktop notification) _javascript tips

Source: Internet
Author: User
Tags set time time interval visibility

This article illustrates the way that JavaScript realizes the countdown effect of work. Share to everyone for your reference. Specifically as follows:

Weekend, get a countdown to work, entertainment.

Make sure that the following three points:

1, non IE browser, higher chrome version, has opened HTML5 desktop notice. See screenshot below for specific settings
2, put this HTML on the local Web server test, directly double-click to run can not pop-up desktop alerts

Incidentally, this program can easily be extended to regular notifications.

The process of doing this thing is two points more tangled, summed up:

1, parseint ("09") returns 0. The correct approach is parseint ("09", 10), explicitly specifying the cardinality as decimal
2, False and "false", this is also a little bit tangled, started me like this
$ ("#minute"). attr ("ReadOnly", "false");
But it doesn't work, because the ReadOnly property is actually only two values true or false, so if I set its value to "false", it is equivalent to setting (the Non-null string to Boolean type is true):
$ ("#minute"). attr ("ReadOnly", true);

Update:

Fixed some minor bugs, and realized that "it's not easy to look very simple".

The effect is as shown in the following illustration:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

The

wants this article to help you with your JavaScript programming.

Related Article

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.