![]() ![]() In your case (1 hour) you have just to replace the 1 by 60 in this line : var endDate = Date.now() + 1*60*1000 // For you. ![]() $.removeCookie('endDate') //removing end date from cookies Var counter = $.cookie('endDate')-currentDate I dont know why but after 00:59 it becomes 00:00 then 00:58. I downloaded few mins ago from here and tried to run from my localhost - ( Internet is on So jQuery from google CDN could be loaded ), I tried the example files and none of the example starts ticking. * counter will be at first 1 min if the user refresh the page the counter willīe the difference between current and end Date, so like this counter canĬontinue the countdown normally in case of refresh. I'm working on a simple countdown timer from 1:00 minute to 0 using FlipClock.js, my problem is, it doesn't count until 0, then when it resets, it starts in 00:59 which it should be 1:00. $('.message').html('The clock has stopped!') ![]() $.cookie('endDate', Math.round(endDate / 1000)) store end date If it's not yet in cookies I getting the event date dynamically and using it inside the FlipClock instance and though the countdown. Var currentDate = Math.round(new Date() / 1000) I'm attempting to display a count down clock for an event in my Laravel 5.4 application. Now if the user refresh page, we set the Timer with difference between current and end Date, so like this counter can continue the countdown normally : var counter = $.cookie('endDate')-currentDate Ĭlicking in reset button will reset the counter by removing the cookie endDate and initializing countdown function. In init() function of flipclock storing the End Date in cookies, init timer with tTime(), enable countdown with tCountdown(true) and start it by clock.start(). The flip clock countdown gadget lets you keep users informed about an upcoming event and get people excited This gadget counts down to a date and time you pick and shows a custom message and animation when the timer reaches zero. Yes you can do it basing in your example using flipclock and jquery-cookie take a look at 1 minute countdown Example. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |