Here, I will explain how to use JQurey plug-in for count down.
Description
sometimes we see in the many website running timer for the countdown that is indicating how many time left in something happening, like restaurant opening, product selling, new tv show coming etc. A simple, easy-to-use yet highly customizable jquery countdown plug-in which helps you count down to any special event.
For doing this we can use count down jquery plugin with lots of animated functionalities.
Step 1
create a web web application like java web application or asp.net web application.
In my case I used asp.net web application.
Download JQuery count down plugin which is easily available on Google.
Step 2
In html head block we use this plugin and write a small jquery function for showing count down in div container and css for html elements.
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
- </script>
- <script src="Scripts/jquery.countdown.js" type="text/javascript"></script>
-
- <script type="text/javascript">
- $(function () {
-
- $('#counter').countdown({
- image: 'images/digits.png',
- startTime: '01:10:40:10',
- timerEnd: function() { alert('Time up!'); }
- });
-
- });
-
- </script>
- <style type="text/css">
-
- .cntSeparator
- {
- font-size: 60px;
- margin: 10px 8px;
- color: #000;
- }
-
- .desc div
- {
- float: left;
- font-family: Arial;
- width: 80px;
- margin-right: 60px;
- font-size: 15px;
- font-weight: bold;
- color: Blue;
- }
- </style>
Step 3
In html body we add some html elements for showing count down.
- <h2 style="color: #00FF00">
- Count down Script
- </h2>
- <center>
- <div id="counter">
- </div>
- <div class="desc">
- <div>
- Days</div>
- <div>
- Hours</div>
- <div>
- Minutes</div>
- <div>
- Seconds</div>
- </div>
Run the application and check count down time.