The code is visible at https://www.handsearseyes.fun/Ears/EarTrainer/EarTrainer.php?EDO=44&UpToTritave=&Sound=clarinet&Format=mp3&RatioBasedScale= -> press the ‘Play Interval’ Button and a Timer will appear which is driven through JavaScript. Here’s the JS driving the timer and Timer tag :
<script>
function StartTimer() {
TimerInterval = setInterval(function() {
var NewDate = new Date();
var Now = NewDate.getTime();
Elapsed = Math.round((Now - GameStartTime) / 1000);
var MinutesElapsed = 0;
while (60 <= Elapsed) {
Elapsed = Elapsed - 60;
MinutesElapsed++;
}
var SecondsElapsed = Elapsed;
if (SecondsElapsed < 10) {
SecondsElapsed = '0'+SecondsElapsed;
}
document.getElementById('Timer').innerHTML = MinutesElapsed+':'+SecondsElapsed;
},100);
}
</script>
[...]
<!-- Timer -->
<div id='Timer' draggable=true style='position:absolute; z-index:1; top:32px; width:125px; height:55px; text-align:center;
font-family:segoe ui variable display; color:#5D729F; cursor:grab' onDragStart="GrabElement(this,event,'EarTrainer.php');"
onDragEnd='ReleaseElement();' onMouseEnter='SwitchHooveredElementTo(this);' onMouseLeave='FalsifyHooveredElement();'></div>
All events on the tag drive the element’s resizing and moving functionalities, but when you try to grab the timer to displace it, you have to grab and move within the same second or your drag is lost. It seems resizing it up (SHIFT + MOUSE WHEEL UP while hoovering it) before trying to drag it cancels this negative effect, somehow (that impression may just be the fruit of luck on life’s rng and too few tests though).
Any idea of a work around?