From 2f9a206452dfbfcc9224896f7339e6abe237d621 Mon Sep 17 00:00:00 2001 From: palak Date: Wed, 1 Nov 2017 15:21:13 +0530 Subject: [PATCH] add timer --- pages/Home.html | 3 +-- pages/registration.html | 19 ++++++++++--------- script.js | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/pages/Home.html b/pages/Home.html index 0d95024..117f37c 100644 --- a/pages/Home.html +++ b/pages/Home.html @@ -60,8 +60,7 @@
- Fee: Idea stage ₹500 + GST/ Product stage ₹1000 + GST/ Growth stage ₹1000+ GST *

- Deadline: 7 November 2017 + Fee: Idea stage ₹500 + GST/ Product stage ₹1000 + GST/ Growth stage ₹1000+ GST *

diff --git a/pages/registration.html b/pages/registration.html index fc0a9ed..5071738 100644 --- a/pages/registration.html +++ b/pages/registration.html @@ -12,6 +12,7 @@
+

Please select one city.

@@ -30,7 +31,7 @@
- +
Location @@ -52,7 +53,7 @@
- +
Location @@ -74,7 +75,7 @@
- +
Location @@ -96,7 +97,7 @@
- +
Location @@ -123,7 +124,7 @@
- +
Location @@ -145,7 +146,7 @@
- +
Location @@ -167,7 +168,7 @@
- +
Location @@ -189,7 +190,7 @@
- +
Location @@ -211,7 +212,7 @@
- +
Location diff --git a/script.js b/script.js index 7f2fefd..94160a0 100644 --- a/script.js +++ b/script.js @@ -59,6 +59,31 @@ hide: false }; + + var countDownDate = new Date("Nov 9, 2017 00:00:00").getTime(); + // Update the count down every 1 second + var x = setInterval(function() { + // Get todays date and time + var now = new Date().getTime(); + // Find the distance between now an the count down date + var distance = countDownDate - now; + // Time calculations for days, hours, minutes and seconds + var days = Math.floor(distance / (1000 * 60 * 60 * 24)); + var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); + var seconds = Math.floor((distance % (1000 * 60)) / 1000); + $scope.timer = days + "d " + hours + "h " + + minutes + "m " + seconds + "s " + // Output the result in an element with id="demo" + document.getElementById("chennai").innerHTML = days + "d " + hours + "h " + + minutes + "m " + seconds + "s "; + // If the count down is over, write some text + if (distance < 0) { + clearInterval(x); + document.getElementById("chennai").innerHTML = "EXPIRED"; + } + }, 1000); + $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ // $scope.Textshow = "yes" -- 2.0.0