R
R
Roman Tuzov2021-03-22 23:47:34
MySQL
Roman Tuzov, 2021-03-22 23:47:34

How to count from 0 and beyond?

605901952365f210818386.png
Above is a screenshot of what the timer looks like. Each digit is a stylized span. It is necessary to make it so that the countdown goes from 0 to infinity with an interval of a certain number of seconds (then I will set it myself).
In general, I figured out how to make a countdown from 0 to infinity, but I didn’t figure out how to make it so that when the number 9 is reached, it becomes 0 in this span, and writes 1,2,3 in the span on the left .. Well, in general, it’s clear that I want each number to be styled like on the screen. Well, I didn’t figure out how to reset at 00:00 hours)
I think this is a simple question for experts and I hope that you will help me in this matter. Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Skibin, 2018-03-04
@xynd3r

Something like this?

SELECT * 
FROM `images_category`
WHERE `id` NOT IN (
    SELECT `images_category`.`id` 
    FROM `images_category` 
    JOIN `images_to_category` ON (`images_category`.`id` = `images_to_category`.`id_category`) 
    WHERE `images_to_category`.`id_file` = 15 )

R
Ruslan., 2018-03-04
@LaRN

If I understood the task correctly, then something like this
SELECT *
FROM images_category
Left Join images_to_category
ON images_category.id = images_to_category.id_category
AND images_to_category.id_file = 15
WHERE images_to_category.id_category is null

0
0xD34F, 2021-03-23
@Hutson

A fixed number of digits of the number is displayed, zeros are substituted for the missing ones:

function output(value) {
  const digits = document.querySelectorAll('селектор span`ов');
  const { length } = digits;

  Array
    .from(`${value}`.padStart(length, 0).slice(-length))
    .forEach((n, i) => digits[i].innerText = n);
}

The number is displayed as it is , the number of spans is not fixed:
function output(value) {
  document.querySelector('селектор родительского элемента span`ов').innerHTML = Array
    .from(`${value}`, n => `<span>${n}</span>`)
    .join('');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question