03-26-2018 18:48
03-26-2018 18:48
Hello,
I'm trying to move the text tag horizontally to the left based on the hour value. The style.x javascript method does not appear to work. Do you have any other solutions please?
<svg class="background"> <text id="myHour" /> <text id="myMinutes" /> </svg>
const MYMINUTES = document.getElementById("myMinutes");
if (preferences.clockDisplay === "12h") {
// 12h format
hours = hours % 12 || 12;
} else {
// 24h format
hours = util.zeroPad(hours);
}
//Readjust min position based on hour
if (hours < 10) {
MYMINUTES.style.x='30%+10';
} else {
MYMINUTES.style.x='50%+10';
}
Answered! Go to the Best Answer.
Best Answer03-26-2018 19:03
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
03-26-2018 19:03
Try just MYMINUTES.x. I've done something similar and that sort of thing worked for me.
03-26-2018 19:03
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
03-26-2018 19:03
Try just MYMINUTES.x. I've done something similar and that sort of thing worked for me.
03-26-2018 20:13
03-26-2018 20:13
That worked! Thank you
Best Answer