June 3, 201214 yr Hi all, this seems to be a really trivial problem but for a day's googling I still haven't got a satisfactory answer. I have a SVG file of a weather gauge with pointer. I can easily change the angle of rotation of the pointer via the javascript setAttribute: pointer.setAttribute('transform', 'rotate(' + angle + ' ,x, y)') but I want to 'ease' the changes that occur in the rotation angle. I have played around with both setTimeout and setInterval, but I cannot get a nice change from the old angle to the new. I have tried to achieve this by both a 'while' and 'for' loop, but it appears that the loop finishes before the first setTimeout even kicks in. I know this kind of thing can be done with libraries, but it's definitely overkill for my requirements. It's probably my logic, but any advice would be appreciated, cheers in advance Edited June 3, 201214 yr by Igg
Create an account or sign in to comment