On Sun, 03 Aug 2008 22:29:24 +0200, cwflamont
<[EMAIL PROTECTED]> wrote:
> "pete.haikonen" wrote:
>
>> say I have a path:
>> <path d="M 1 2 C 3 4 5 6 7 8" />
>>
>> i.e. 4 curve points. Please, how do I change the position of a point?
>> In Javascript? One way is to rebuild the "d" attribute and re-assign
>> it but there has (?) to be another way?
Yes there is, but only if you want to have the same number of points. Then
you can use animation:
<path d="M 1 2 C 3 4 5 6 7 8">
<animate attributeName="d" to="M 1 2 C 3 4 5 6 11 12" dur="1s"
fill="freeze" />
</path>
or variations, like
<path d="M 1 2 C 3 4 5 6 7 8" id="thePath"/>
...
<animate xl:href="thePath" attributeName="d" to="M 1 2 C 4 3 6 5 8 7"
dur="3s" begin="thePath.click" fill="freeze" />
and so on. Note that this changes the rendering (what you see) but doesn't
change the DOM, so scripts will be manipulating the original values, not
the changed version. The advantage of this is that it needs no scripting
(for me that is an advantage, anyway). The disadvantage is that while
animation works in Opera, the Adobe Plugins, and the various
mobile-phone-based SVG players, support is still pretty partial in Safari
and is only scheduled to begin in Firefox 3.1. So it depends on your use
case still :( (Ten years after SVG appeared...)
cheers
Chaals
--
Charles McCathieNevile Opera Software, Standards Group
je parle français -- hablo español -- jeg lærer norsk
http://my.opera.com/chaals Try Opera 9.5: http://www.opera.com
------------------------------------
-----
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/