Want to create interactive content? It’s easy in Genially!
Genially senza titolo
Simona Vella
Created on April 16, 2024
Start designing with a free template
Discover more than 1500 professional designs like these:
Transcript
YOUR TIME
You did it! You have an incredible memory!
HH:MM:SS
Congratulations!
<div style="width:100%; height:100%;" id="CHRONO"></div> <script> function dateHMS(time) { var addZero = function(v) { return v<10 ? '0' + v : v; }; var d = new Date(time); var t = []; t.push(addZero(d.getUTCHours())); t.push(addZero(d.getMinutes())); t.push(addZero(d.getSeconds())); return t.join(':'); } function getParent(name) { var pnode = document.getElementById(name).parentNode.parentNode.parentNode; while (pnode.getAttribute('id') == null) { pnode = pnode.parentNode; } return (pnode); } function getSibling(name) { var pnode = getParent(name); var divList = pnode.getElementsByTagName('div'); var i; var lastDiv = null; for (i = 0; i < divList.length; i++) { if (divList[i].getAttribute('data-genially-id') != null) { lastDiv = divList[i]; } } if (lastDiv == null) { lastDiv = null; } return lastDiv; } function chrono(){ var debut = sessionStorage.getItem('debut'); if (debut!=null){ var sibling = getSibling('CHRONO'); var suite=new Date().getTime(); var difference=suite-debut; var chrono=dateHMS(difference); sibling.innerHTML=chrono; } } var url = window.location.pathname.split( "/" ); var refgenial= url[1]; if (refgenial!="editor"){ chrono(); document.getElementById('CHRONO').style.display='none'; var myChrono = setInterval(chrono, 1000); } </script>