- SCRIPT 1:
At the end of the set time the countdown starts again the count but from a second set time. At the end of the time the countdown will always start from this second set time. That is until the localStorage expires.
So in summary, you need to set two times, the first is used only the first time while the sendondo is always used and cyclically until the localStorage expires. After the localStorage expires the countdown starts again from the first time set and so on.
- SCRIPT 2:
- SCRIPT 1 e SCRIPT 2:
Both scripts must use localStorage so that the countdown does not reset every time you refresh the page. I must be able to set the duration of the localStorage (please see example).
Both scripts are executed in multiple pages and for each of these pages the scripts must be independent. If it can be useful we have the ID of the page available. In example 2 we use counter_IDpage (counter_99, counter_11 ...) to make the counting independent for each page. If this method is not good please implement a more reliable and secure method.
Both scripts must use the "getElementsByClassName" method so that you can view the results in multiple places on the web page.
Both scripts must be fast and reliable. Also optimized for all recent browsers. Eventually you can use jQuery (1.12.4) if it involves greater reliability, speed and a smaller amount of code.