Hi Andr�,

I would like to know if I can call SVG functions via an HTML page's 
javascript to change the SVG elements attributes.  I am using the 
embed  statement twice within HTML to publish two images of a pump 
on the screen.  The embed statement is calling the same SVG pump.  
Now that I have both images on the screen I want to control the 
color fill of the pumps independently of one another through 
javascript in the HTML page.  Is this possible?  if so do you have 
or know where I can find an example.  I've tried the <symbol> <use> 
combination, but it doesn't suit my purposes because I want to have 
a generic SVG pump, that I can dynamically control through 
javascript.  Take a look at the following code,  this is what I 
would like to do, but move the function to the SVG file, and just 
call it from within javascript.


http://www3.sympatico.ca/sylvie1313/SVG/liqso2.htm
http://www3.sympatico.ca/sylvie1313/SVG/pump3.svg

Regards,

Norm


--- In [EMAIL PROTECTED], "Andr� M. Winter" 
<[EMAIL PROTECTED]> wrote:
> hi,
> 
> you could use <symbol> and <use>. the symbol holds the entire 
pump. 
> imagine the pump is defined only by strokes that cannot hold 
fills. 
> therein you have your donut that could hold a fill but has the 
default 
> green. then you could call pump1 as <use xlink:href="pumpSymbol" 
> fill="green" id=pump1"/>. with 
> document.getElementById('pump1').setAttributeNS
(null,'fill','blue') you 
> could fill your pumps the way you do now. note that you have to 
take 
> care about the way your base pump is graphicaly definded in order 
to not 
> get filled stuff you don't want to.
> 
> andr�
> 
> 
> 
> satnut28 wrote:
> 
> >Hi All,
> >
> >I've created an SVG file called pump.svg.  I am controlling the 
fill 
> >color of the pump when the value in the "Red" or "blue" form box 
is 
> >changed.  What I need to do is change the fill color of the first 
> >pump, when I change the value in the first form box (RED), and 
> >change the fill color of the secong pump when the value in 
> >the "blue" form box is changed.  Essentially I would like to 
create 
> >one svg file, and make multiple copies of it for display on my 
> >page.  Through javascript I will change different atributes of 
the 
> >pumps based on field conditions.  My problem is how can the image 
> >file be indexed in such a way as to control individual copies of 
the 
> >image??
> >
> >The code can be viewd here.
> >http://www3.sympatico.ca/sylvie1313/SVG/liqso2.htm
> >
> >Any Help would be appreciated.
> >
> >Norm
> >
> >
> >
> >
> >-----
> >To unsubscribe send a message to: svg-developers-
[EMAIL PROTECTED]
> >-or-
> >visit http://groups.yahoo.com/group/svg-developers and 
click "edit my membership"
> >---- 
> >Yahoo! Groups Links
> >
> >
> >
> > 
> >
> >  
> >



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

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

<*> 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