Drupal 6 — jQuery Timer according to

0 like 0 dislike
8 views
Good afternoon, there is a problem on a Drupal 6 site installed script jQuery Timer It counts the time until a certain event and shows how many days are left. If you leave the page open for a while (5-10 minutes) then the script starts to count time faster. Tell me, what can be the reason? The site has caching via the boost module. Disabled caching of js, didn't help.

Maybe you can add a line to the script so the counter is changed only after reloading the page?
by | 8 views

3 Answers

0 like 0 dislike
Maybe the timer is initialized more than once. Check the behaviour and the contexts in it.
by
0 like 0 dislike
I pony have altered. because the use of jQuery timer I have found. For that you are now responsible set_timer_js in setInterval.
by
0 like 0 dislike
Found a piece of code in template.php apparently there is some mistake.
//function generates the markup for the timer. theme_timer function ($time_to_event) { $time = $time_to_event - time(); $timer = array(); $timer['days'] = floor($time / (60 * 60 * 24)); $timer['hours'] = floor(($time - $timer['days'] * 60 * 60 * 24) / (60 * 60)); $timer['minutes'] = floor(($time - $timer['days'] * 60 * 60 * 24 - $timer['hours'] * 60 * 60) / 60); /* if(!drupal_is_front_page()) { //zakamentuj after the installation of the main $timer['second'] = $time - $timer['days'] * 60 * 60 * 24 - $timer['hours'] * 60 * 60 - $timer['minutes'] * 60; } */ $time_part_output = array(); foreach ($timer as $part => $int) { if(strlen($int) < 2) { $timer[$part] = '0' . $int; } if ( in_array($part, array('hours', 'minutes', 'second')) ) { $letter_line = "; } else { $letter_line = ''; } foreach (str_split($timer[$part]) as $key => $symvol) { $time_part_output[$part] .= '' . $letter_line . '' . $symvol . ''; } } /* if(!drupal_is_front_page()) { return $time_part_output['days'] . $time_part_output['hours'] . ' : ' . $time_part_output['minutes'] . ' : ' . $time_part_output['second']; } */ return $time_part_output['days']. $time_part_output['hours'] . $time_part_output['minutes'] . $time_part_output['second']; } /*FUNCTIONS RETURN THE MARKUP FOR THE PAGE HEADER*/ 
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
32,855 users