var x = parseInt(new Date().getTime()/1000);
// x нигде больше не используется, почему сразу не присвоить now_time?
var a = a; // эти строки вообще не нужны
var b = b;
var c = c;
var d = d;
var now_time = x;
if(c>0){
if(b > 0 && a > 0){
if(c>0 && b > 0 && a > 0){
или даже if(a && b && c)
если они отрицательными не бывают.function calc_sum(a, b, c, d, N) {
if (a && b && c) {
var now_time = parseInt(new Date().getTime()/1000);
var timer = c < now_time ? now_time - c : 0;
var per_sec = (a / 3600 / d).toFixed(10);
$('#countSum'+N).html((per_sec * b * timer).toFixed(2));
}
}
function calc_sum(a, b, c, d, N) {
if (a && b && c) {
var now_time = parseInt(new Date().getTime()/1000);
$('#countSum'+N).html(((a / 3600 / d).toFixed(10) * b * (c < now_time ? now_time - c : 0)).toFixed(2));
}
}
но это совсем моск выносит. /(?:^|\s)слово/u.test('слово') // -> true
/(?:^|\s)слово/u.test('неслово') // -> false
/**
* Returns plural form
* @param integer $n number of items
* @param string $one
* @param string $some
* @param string $many
* @example echo plural_form(42, 'арбуз', 'арбуза', 'арбузов');
*/
public static function pluralForm($n, $one, $some, $many) {
return $n%10==1&&$n%100!=11?$one:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$some:$many);
}
Возвращаемые значения
Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.
.no_focus
- вызывать prefentDefault()Definition and Usage
The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document).
The id attribute is most used to point to a style in a style sheet, and by JavaScript (via the HTML DOM) to manipulate the element with the specific id.
$('.timer').each(function(){
$timer = $(this)
setInterval(function(){
let day = $timer.find('.TD').text(),
hours = $timer.find('.TH').text(),
minutes = $timer.find('.TI').text(),
seconds = $timer.find('.TS').text();
// ...
}, 1000)
})