CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Timer plugin won't work after executed once (http://www.codingforums.com/showthread.php?t=278940)

Mr. 10-23-2012 07:18 PM

Timer plugin won't work after executed once
 
I am using This Timer Plugin to create a timer once a button is clicked. You can see it in action here If you notice, when you click any of the purchase buttons twice, it is ignored and will not be executed again. I cannot figure out how to correct this. I need to the timer to restart anytime I click the button once the timer is finished.

Here is the the HTML I am using on the first button:

Code:

    <h3 class="protection"><span id="sentryTime">00:00:00</span><a href="javascript:sentry()">Purchase Sentry</a></h3>
And here is the javascript I am using on that button which calls the plugin to create the timer:

Code:

function sentry() {
            var dateCreated1 = new Date();
    setCharacterTime(/*hr*/0,/*min*/0,/*sec*/5,/*title*/'sentryTime',dateCreated1)}
   
   
    function setCharacterTime(hours, minutes, seconds, title, creationDate) {
   
            var thisDay = creationDate;
            var year = thisDay.getFullYear();
            var month = thisDay.getMonth();
            var day = thisDay.getDate();
            var aHour = thisDay.getHours();
            var aMinutes = thisDay.getMinutes();
            var aSeconds = thisDay.getSeconds();
            var aMilli = thisDay.getMilliseconds();
            thisDay = new Date(year, month, day, aHour + hours, aMinutes + minutes, aSeconds + seconds, aMilli);
            $('#' + title).countdown({until: thisDay, format: 'HMS', layout: ' {hnn}{sep}{mnn}{sep}{snn}', expiryText: 'complete '});
            ;} //end setCharacterTime() function

If you need to see the jQuery plugin, you can find it live here.

WolfShade 10-23-2012 07:23 PM

Check the error console for messages.

Mr. 10-23-2012 07:35 PM

How do I do that?

WolfShade 10-23-2012 07:41 PM

If you are using IE, look in the lower-left corner of the browser for a yellow triangle with an exclamation point (!) in it. Double click it to see the error message. If it's not there, then there is no error message.

If you are using FireFox, click on the menu and look for "Web Developer" and under that "Web Console".

Mr. 10-23-2012 07:53 PM

There are no errors.


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.