Yes.... what he said :) DD ________________________________
From: [email protected] on behalf of Erik Dahlström Sent: Wed 10/24/2007 4:07 AM To: [email protected] Subject: Re: [svg-developers] svg clock for mobile On Tue, 23 Oct 2007 23:47:59 +0200, ddailey <[EMAIL PROTECTED]> wrote: > Hmmm... Thomas in Opera the current time for your link shows just fine > (though it starts at midnight in IE). > > A similar thing http://srufaculty.sru.edu/david.dailey/svg/clock.svg > also using SMIL seems to show current time in both IE and Opera. > > In looking at your code, I believe this is why: > > you use JavaScript to reset the rotation of each of the clock hands: > > var h_hrs = owner.getElementById("hourHand"); > h_hrs.setAttributeNS(null, "transform", > "rotate("+ (30*hrs+0.5*min) +",105,105)"); You should note that <!-- isn't really a comment in the script, see e.g. http://lachy.id.au/log/2005/05/script-comments. Since you have specified additive="sum" on the "hourHand" animateTransform element that means that the animateTransform transform will get postmultiplied on the hourHand transform. Then since the "comment" in the script wasn't really treated as a comment it will set the time also. So a simple fix is: make the "comment" in the script a real comment, by using /* ... */ or // ... Either way worked fine for me, that is either using setCurrentTime or setting the transforms. If you do both however, then you get both. Also it won't work in IE/ASV because type="text/ecmaScript" has an uppercase S. Replacing that with "text/ecmascript" makes the script run fine. > The problem (I suspect), at least in IE and possibly Nokia, is that the > animateTransform that you've attached to the objects uses its own default > rotation angles (specified through markup) to override any attributes > associated with the rotation itself. That is the > transform="rotate(string)"is being clobbered by the animation itself. > Why Opera wouldn't do that, Idon't know, but that browser has the > sometimes uncanny ability to figureout what we are trying to accomplish. According to the SVG spec[1] the transform on the target element shouldn't get overwritten when additive="sum" is used in an animateTransform, but you can use additive="replace" to get that effect if you want. I think both ASV and Opera behaves this way, at least the simple examples in the spec looked the same when I tried them. Cheers /Erik [1] http://www.w3.org/TR/SVG11/animate.html#AnimateTransformElement -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links [Non-text portions of this message have been removed] ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

