Bo znalazłem mase skryptów które odliczają ale po calej dacie e.g 208/12/05 12:35 a ja potrzebuje tylko odliczac czas e.g czas koncowy to 13:35 wszystko mam juz obliczone oblicza mi poprawnie teraz jak do tego podlaczyc liczniczek zeby tylko czas odliczalo bez potrzeby daty. Jesli odwiedzajacy ten temat nie moze nic poradzic na licznik niech ktos mi powie dlaczego moj ostatni elseif nie dziala

w sensie ostatni if sprawdza ( chyba ) czy rzad OpeningTimes zawiera NUll lub 0 i powinna wyswietlic sie wiadomosc jesli ten rzad jest pusty ale nic z tego
Ok znalazlem skrypt z ktorym prawdopodobnie bym sobie poradzil mianowicie zamienic ale teraz mam takie cosik
RESOLVED: Udalo sie przeniesc dwukropek
if (li % 3 == 0){
newComma = doc.createElement("ul");
newComma.className = 'cd';
newComma.innerHTML = '
<li class="s"></li>';
div.insertBefore(newComma, div.firstChild);
}
powyzszy kod mianowicie dodaje mi li s czyli dwukropek jako 2 miejsce a ja chce pomiedzy. Dla przyklady godzina 13:56 uzywajac tego skryptu renderuje mi 1:356 teraz probowalem wszystkiego zeby zmienic pozycje dwukropka ale nie wychodzi jakies pomysly

? szkolahtml.pl/day.php
Edit: Udalosie przeniesc dwukropek w porzadane miejsce teraz jaki problem mam to 3 rzad zaczyna odliczanie od 00,99,98,97 itd jest jakis sposob zeby zaczac od 60 ?
Temat zamkniety znalazlem odpowiedz na temat odliczania podaje rozwiazanie dla tych ktorzy keidykolwiek beda potrzebowali odliczania z wieksza mozliwoscia dostosowania do rezultatu
W index.php czy tam html
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="js/flipcounter.js"></script>
dalej przed tagiem konczacym body
<script type="text/javascript"> $(function(){
$('#opening').countdown({
image:'digits2.png',
startTime:'<? echo date('H:i:s', $closingdown) ?>'
});
});
js/flipcounter.js
/*
* jquery-counter plugin
*
* Copyright (c) 2009 Martin Conte Mac Donell <Reflejo@gmail.com>
* Dual licensed under the MIT and GPL licenses.
*
*
<a href="http://docs.jquery.com/License" target="_blank">http://docs.jquery.com/License
</a> *
* IE fix by Andrea Cardinale <a.cardinale@webandtech.it> [23 September 2009]
* IE fix added by Giguashvili, Levan <levangig@gmail.com> [04 April 2011]
*/
jQuery.fn.countdown = function(userOptions)
{
// Default options
var options = {
stepTime: 60,
// startTime and format MUST follow the same format.
// also you cannot specify a format unordered (e.g. hh:ss:mm is wrong) tutaj ustawiamy sobie format
format: "hh:mm:ss",
startTime: "12:32:55",
digitImages: 6,
digitWidth: 21,
digitHeight: 32,
timerEnd: function(){},
image: "digits2.png"
};
var digits = [], interval;
// Draw digits in given container
var createDigits = function(where)
{
var c = 0;
options.startTime = options.startTime.split('');
options.format = options.format.split('');
var tempStartTime = options.startTime;
var tempFormat = options.format;
// Iterate each startTime digit, if it is not a digit
// we'll asume that it's a separator
for (var i = 0; i < tempStartTime.length; i++)
{
if (parseInt(tempStartTime.charAt(i)) >= 0)
{
elem = jQuery('
<div id="cnt_' + i + '" class="cntDigit" />').css({
height: options.digitHeight * options.digitImages * 10,
float: 'left', background: 'url(\'' + options.image + '\')',
width: options.digitWidth});
digits.push(elem);
margin(c, -((parseInt(tempStartTime.charAt(i)) * options.digitHeight *
options.digitImages)));
digits[c].__max = 9;
// Add max digits, for example, first digit of minutes (mm) has
// a max of 5. Conditional max is used when the left digit has reach
// the max. For example second "hours" digit has a conditional max of 4
switch (tempFormat.charAt(i)) {
case 'h':
digits[c].__max = (c % 2 == 0) ? 2: 9;
if (c % 2 == 0)
digits[c].__condmax = 4;
break;
case 'd':
digits[c].__max = 9;
break;
case 'm':
case 's':
digits[c].__max = (c % 2 == 0) ? 5: 9;
}
++c;
}
else
elem = jQuery('
<div class="cntSeparator"/>').css({float: 'left'})
.text(tempStartTime.charAt(i));
where.append(elem);
}
};
// Set or get element margin
var margin = function(elem, val)
{
if (val !== undefined)
return digits[elem].css({'marginTop': val + 'px'});
return parseInt(digits[elem].css('marginTop').replace('px', ''));
};
// Makes the movement. This is done by "digitImages" steps.
var moveStep = function(elem)
{
digits[elem]._digitInitial = -(digits[elem].__max * options.digitHeight * options.digitImages);
return function _move() {
mtop = margin(elem) + options.digitHeight;
if (mtop == options.digitHeight) {
margin(elem, digits[elem]._digitInitial);
if (elem > 0) moveStep(elem - 1)();
else
{
clearInterval(interval);
for (var i=0; i < digits.length; i++) margin(i, 0);
options.timerEnd();
return;
}
if ((elem > 0) && (digits[elem].__condmax !== undefined) &&
(digits[elem - 1]._digitInitial == margin(elem - 1)))
margin(elem, -(digits[elem].__condmax * options.digitHeight * options.digitImages));
return;
}
margin(elem, mtop);
if (margin(elem) / options.digitHeight % options.digitImages != 0)
setTimeout(_move, options.stepTime);
if (mtop == 0) digits[elem].__ismax = true;
}
};
jQuery.extend(options, userOptions);
this.css({height: options.digitHeight, overflow: 'hidden'});
createDigits(this);
interval = setInterval(moveStep(digits.length - 1), 1000);
};
jQuery.fn.countdown = function(userOptions)
{
// Default options
var options = {
stepTime: 60,
// startTime and format MUST follow the same format.
// also you cannot specify a format unordered (e.g. hh:ss:mm is wrong)
format: "dd:hh:mm:ss",
startTime: "01:12:32:55",
digitImages: 6,
digitWidth: 21,
digitHeight: 32,
timerEnd: function(){},
image: "digits.png"
};
var digits = [], interval;
// Draw digits in given container
var createDigits = function(where)
{
var c = 0;
var tempStartTime = options.startTime;
// Iterate each startTime digit, if it is not a digit
// we'll asume that it's a separator
for (var i = 0; i < options.startTime.length; i++)
{
if (parseInt(tempStartTime.charAt(i)) >= 0)
{
elem = jQuery('
<div id="cnt_' + i + '" class="cntDigit" />').css({
height: options.digitHeight * options.digitImages * 10,
float: 'left', background: 'url(\'' + options.image + '\')',
width: options.digitWidth});
digits.push(elem);
margin(c, -((parseInt(tempStartTime.charAt(i)) * options.digitHeight *
options.digitImages)));
digits[c].__max = 9;
// Add max digits, for example, first digit of minutes (mm) has
// a max of 5. Conditional max is used when the left digit has reach
// the max. For example second "hours" digit has a conditional max of 4
switch (options.format[i]) {
case 'h':
digits[c].__max = (c % 2 == 0) ? 2: 9;
if (c % 2 == 0)
digits[c].__condmax = 4;
break;
case 'd':
digits[c].__max = 9;
break;
case 'm':
case 's':
digits[c].__max = (c % 2 == 0) ? 5: 9;
}
++c;
}
else
elem = jQuery('
<div class="cntSeparator"/>').css({float: 'left'})
.text(tempStartTime.charAt(i));
where.append(elem);
}
};
// Set or get element margin
var margin = function(elem, val)
{
if (val !== undefined)
return digits[elem].css({'marginTop': val + 'px'});
return parseInt(digits[elem].css('marginTop').replace('px', ''));
};
// Makes the movement. This is done by "digitImages" steps.
var moveStep = function(elem)
{
digits[elem]._digitInitial = -(digits[elem].__max * options.digitHeight * options.digitImages);
return function _move() {
mtop = margin(elem) + options.digitHeight;
if (mtop == options.digitHeight) {
margin(elem, digits[elem]._digitInitial);
if (elem > 0) moveStep(elem - 1)();
else
{
clearInterval(interval);
for (var i=0; i < digits.length; i++) margin(i, 0);
options.timerEnd();
return;
}
if ((elem > 0) && (digits[elem].__condmax !== undefined) &&
(digits[elem - 1]._digitInitial == margin(elem - 1)))
margin(elem, -(digits[elem].__condmax * options.digitHeight * options.digitImages));
return;
}
margin(elem, mtop);
if (margin(elem) / options.digitHeight % options.digitImages != 0)
setTimeout(_move, options.stepTime);
if (mtop == 0) digits[elem].__ismax = true;
}
};
jQuery.extend(options, userOptions);
this.css({height: options.digitHeight, overflow: 'hidden'});
createDigits(this);
interval = setInterval(moveStep(digits.length - 1), 1000);
};