Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  36] [ 7]  / answers: 1 / hits: 41013  / 7 Years ago, thu, september 28, 2017, 12:00:00

In typescript how to change css styling just as I would do this way?



$(.s-hand).css(transform, translate(-50%, -100%) rotate( + s*6 + deg));


or



var hourPointer   = document.querySelector('.hour')
hourPointer.style[transform] = `rotate(${hour}deg)`;


Because I have no idea how to achieve that..


More From » css

 Answers
18

It has to be done like this:



let shand = document.getElementsByClassName('s-hand') as HTMLCollectionOf<HTMLElement>;

if (shand.length != 0) {
shand[0].style.transform = translate(-50%, -100%) rotate( + s * 6 + deg);
}

[#56363] Monday, September 25, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
simone

Total Points: 558
Total Questions: 96
Total Answers: 99

Location: British Indian Ocean Territory
Member since Tue, Feb 22, 2022
2 Years ago
;