Ребята помогите пожалуйста.
Мне нужно чтобы счетчик начинал отсчитывать ежедневно в 8 часов вечера и заканчивал в это же время. И потом повторялся.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
<script language="Javascript" type="text/javascript" src="js/jquery-1.4.1.js"></script>
<script language="Javascript" type="text/javascript" src="js/jquery.lwtCountdown-0.9.5.js"></script>
<script language="Javascript" type="text/javascript" src="js/misc.js"></script>
<link rel="Stylesheet" type="text/css" href="style/dark.css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="container">
<div id="countdown_dashboard">
<div class="dash weeks_dash">
<span class="dash_title">недель</span>
<div class="digit">0</div>
<div class="digit">0</div>
</div>
<div class="dash days_dash">
<span class="dash_title">дней</span>
<div class="digit">0</div>
<div class="digit">0</div>
</div>
<div class="dash hours_dash">
<span class="dash_title">часов</span>
<div class="digit">0</div>
<div class="digit">0</div>
</div>
<div class="dash minutes_dash">
<span class="dash_title">минут</span>
<div class="digit">0</div>
<div class="digit">0</div>
</div>
<div class="dash seconds_dash">
<span class="dash_title">секунд</span>
<div class="digit">0</div>
<div class="digit">0</div>
</div>
</div>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function() {
$('#countdown_dashboard').countDown({
targetDate: {
'day': 21,
'month': 12,
'year': 2014,
'hour': 17,
'min': 34,
'sec': 15 }
});
});
</script>
</div>
</body>
</html>
function email_focus() {
if ($(this).val() == 'your@email.com') {
$(this).val('')
$(this).removeClass('faded');
}
}
function email_blur() {
if ($(this).val() == '') {
$(this).val('your@email.com')
$(this).addClass('faded');
}
}
function subscribe_submit() {
email = $('#email_field').val();
$.post('subscribe.php?json=1', $('#subscribe_form').serialize(), subscribe_result, 'json');
$('#subscribe_button').attr("disabled","disabled");
$('.form_message').fadeOut('fast');
$('#loading').fadeIn('fast');
return false;
}
function subscribe_result(data) {
$('#loading').hide();
if (data.error) {
display_message(data.error);
} else {
display_message(data.info, 'info')
}
$('#subscribe_button').removeAttr("disabled");
}
function display_message(msg, type) {
if (!type) type = 'error';
if (type == 'error') {
$('#error_message').html(msg).fadeIn('slow');
setTimeout('hide_error()', 4000);
} else {
$('#error_message').hide();
$('#info_message').html(msg).fadeIn('slow');
}
}
function hide_error() {
$('#error_message').fadeOut('slow');
}
(function($){
$.fn.countDown = function (options) {
config = {};
$.extend(config, options);
diffSecs = this.setCountDown(config);
$('#' + $(this).attr('id') + ' .digit').html('<div class="top"></div><div class="bottom"></div>');
$(this).doCountDown($(this).attr('id'), diffSecs, 500);
if (config.onComplete)
{
$.data($(this)[0], 'callback', config.onComplete);
}
if (config.omitWeeks)
{
$.data($(this)[0], 'omitWeeks', config.omitWeeks);
}
return this;
};
$.fn.stopCountDown = function () {
clearTimeout($.data(this[0], 'timer'));
};
$.fn.startCountDown = function () {
this.doCountDown($(this).attr('id'),$.data(this[0], 'diffSecs'), 500);
};
$.fn.setCountDown = function (options) {
var targetTime = new Date();
if (options.targetDate)
{
targetTime.setDate(options.targetDate.day);
targetTime.setMonth(options.targetDate.month-1);
targetTime.setFullYear(options.targetDate.year);
targetTime.setHours(options.targetDate.hour);
targetTime.setMinutes(options.targetDate.min);
targetTime.setSeconds(options.targetDate.sec);
}
else if (options.targetOffset)
{
targetTime.setDate(options.targetOffset.day + targetTime.getDate());
targetTime.setMonth(options.targetOffset.month + targetTime.getMonth());
targetTime.setFullYear(options.targetOffset.year + targetTime.getFullYear());
targetTime.setHours(options.targetOffset.hour + targetTime.getHours());
targetTime.setMinutes(options.targetOffset.min + targetTime.getMinutes());
targetTime.setSeconds(options.targetOffset.sec + targetTime.getSeconds());
}
var nowTime = new Date();
diffSecs = Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);
$.data(this[0], 'diffSecs', diffSecs);
return diffSecs;
};
$.fn.doCountDown = function (id, diffSecs, duration) {
$this = $('#' + id);
if (diffSecs <= 0)
{
diffSecs = 0;
if ($.data($this[0], 'timer'))
{
clearTimeout($.data($this[0], 'timer'));
}
}
secs = diffSecs % 60;
mins = Math.floor(diffSecs/60)%60;
hours = Math.floor(diffSecs/60/60)%24;
if ($.data($this[0], 'omitWeeks') == true)
{
days = Math.floor(diffSecs/60/60/24);
weeks = Math.floor(diffSecs/60/60/24/7);
}
else
{
days = Math.floor(diffSecs/60/60/24)%7;
weeks = Math.floor(diffSecs/60/60/24/7);
}
$this.dashChangeTo(id, 'seconds_dash', secs, duration ? duration : 800);
$this.dashChangeTo(id, 'minutes_dash', mins, duration ? duration : 1200);
$this.dashChangeTo(id, 'hours_dash', hours, duration ? duration : 1200);
$this.dashChangeTo(id, 'days_dash', days, duration ? duration : 1200);
$this.dashChangeTo(id, 'weeks_dash', weeks, duration ? duration : 1200);
$.data($this[0], 'diffSecs', diffSecs);
if (diffSecs > 0)
{
e = $this;
t = setTimeout(function() { e.doCountDown(id, diffSecs-1) } , 1000);
$.data(e[0], 'timer', t);
}
else if (cb = $.data($this[0], 'callback'))
{
$.data($this[0], 'callback')();
}
};
$.fn.dashChangeTo = function(id, dash, n, duration) {
$this = $('#' + id);
d2 = n%10;
d1 = (n - n%10) / 10
if ($('#' + $this.attr('id') + ' .' + dash))
{
$this.digitChangeTo('#' + $this.attr('id') + ' .' + dash + ' .digit:first', d1, duration);
$this.digitChangeTo('#' + $this.attr('id') + ' .' + dash + ' .digit:last', d2, duration);
}
};
$.fn.digitChangeTo = function (digit, n, duration) {
if (!duration)
{
duration = 800;
}
if ($(digit + ' div.top').html()!= n + '')
{
$(digit + ' div.top').css({'display': 'none'});
$(digit + ' div.top').html((n ? n : '0')).slideDown(duration);
$(digit + ' div.bottom').animate({'height': ''}, duration, function() {
$(digit + ' div.bottom').html($(digit + ' div.top').html());
$(digit + ' div.bottom').css({'display': 'block', 'height': ''});
$(digit + ' div.top').hide().slideUp(10);
});
}
};
})(jQuery);
Ребят выручайте борюсь с этим битые сутки так и не нашел примера кода в интернете.