Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2012, 07:18 PM   PM User | #1
Mr.
Regular Coder

 
Join Date: Feb 2011
Posts: 112
Thanks: 8
Thanked 4 Times in 4 Posts
Mr. is an unknown quantity at this point
Unhappy 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.
Mr. is offline   Reply With Quote
Old 10-23-2012, 07:23 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 960
Thanks: 7
Thanked 100 Times in 100 Posts
WolfShade is an unknown quantity at this point
Check the error console for messages.
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Old 10-23-2012, 07:35 PM   PM User | #3
Mr.
Regular Coder

 
Join Date: Feb 2011
Posts: 112
Thanks: 8
Thanked 4 Times in 4 Posts
Mr. is an unknown quantity at this point
How do I do that?
Mr. is offline   Reply With Quote
Old 10-23-2012, 07:41 PM   PM User | #4
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 960
Thanks: 7
Thanked 100 Times in 100 Posts
WolfShade is an unknown quantity at this point
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".
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Old 10-23-2012, 07:53 PM   PM User | #5
Mr.
Regular Coder

 
Join Date: Feb 2011
Posts: 112
Thanks: 8
Thanked 4 Times in 4 Posts
Mr. is an unknown quantity at this point
There are no errors.
Mr. is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, jquery, timer, timer plugin

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:39 AM.


Advertisement
Log in to turn off these ads.