O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating a Label control to create a digital clock

This recipe uses custom animation effects to create a blinking digital clock to display the current time in the hh:mm:ss format. The constructs used in this example are summarized in the following table:

Construct

Type

Description

$("#identifier")

jQuery selector

This selects an element using its ID.

.animate()

jQuery method

This performs a custom animation on the specified CSS properties.

Date

JavaScript object

This is an object that stores date/time information: year, month, day, hours, minutes, and seconds.

Date.getHours()

JavaScript function

This returns the number of hours from 0 to 23.

Date.getMinutes()

JavaScript function

This returns the number of minutes from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required