Brendan asks about dynamically changing the content of a pattern.


defs>
    <pattern id="checkerPattern" patternUnits="userSpaceOnUse"
            x="0" y="0" width="20" height="20"
            viewBox="0 0 15 15" >
        <rect x="0" y="0" width="10" height="5" fill="blue"/>
        <rect x="5" y="5" width="15" height="5" fill="blue"/>
    </pattern> 
</defs>  


I thought I had an example around somewhere but didn't find it easily...
Yes, what you wish to do can be done.

I'd do something like 

changePattern("checkerPattern","newPatternGroup")

where:
function changepattern(id,newgroupid){
    var P=document.getElementById(id)
    for (i in P.childnodes){
        P.removeChild(P.items(i))
  }
    //above should clean out the existing stuff in the pattern
    //then add the new stuff
    var G=document.getElementById(newgroupid)
    P.appendChild(G)
}

where newPatternGroup would be a group (probably defined in <defs>)
containing the elements of the new pattern.

I think that oughta work in browsers that support <pattern>

hope this helps
David

[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/
 

Reply via email to