Project:Javascript Timer
Version:7.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

On Firefox the system works well and counts up from "now" using the code

<?php $day=date("Y-m-d H:i:s"); ?>
<p class="timer-float"><span class="jst_timer"><span class="datetime" style="display:none;"><?php print $day; ?></span> <span class="dir" style="display:none;">up</span> <span class="format_txt" style="display:none;">%mins%:%secs%</span> </span></p>

But the system does not work on Chrome, Safari or IE. Is there a way to count up from NOW or implement a simple minute:second timer

Comments

#1

See if you can capture the output as rendered?

Ie without the php tags.

<?php $day=date("Y-m-d H:i:s"); ?>

#2

This is the source from chrome:

<p class="timer-float"><span class="jst_timer"><span class="dir" style="display:none;">up</span><span class="datetime" style="display:none;">2013-01-28 13:28:23</span><span class="format_txt" style="display:none;">%mins%:%secs%</span> </span></p>

This is identical code as shown in Firefox.

#3

Funny, that code snippet works in IE9, Firefox 18 and Chrome 24.0.1312.56 for me.

#4

The code works find but I wanted to use the NOW time so the counter will go up from 00:00. The code works if I do not use PHP to generate the time stamp

#5

Make sure to add the timezone offset if you want to use server time through php.

<?php $day=date("Y-m-d H:i:s") . '-07:00'; ?>

Also you could try just counting up (without the php):

<span class="jst_timer">
<span style="display:none" class="interval">0</span>
<span style="display:none" class="dir">up</span>
</span>

If you just want to start counting up.

nobody click here