um... i have not used raphael.
you want to toggle Class name to $("container") ? or the sub element
created by raphael?
for first one, simply $("container").toggleClassName("...")
for the second one, you have to know how raphael works
but i think raphael will provide a way to the get html element from
c.node (e.g. c.node.elements[0])
toggleClassName can only work in htmlElement, try to find the exact
htmlelement first in order to use html related functions

heeae

On Dec 17, 8:07 pm, code1n <lomov...@gmail.com> wrote:
> hello everyone.
> i'm trying to use raphael svg graphic library with prototype
> there is a question wich is troubeling me - how to extend svg elements
> with prototype?
> For example, i use this code:
>
> r = Raphael($("container"), 300, 300);
> c = r.circle(100, 100, 50);
> c.attr('fill', 'red');
> c.node.toggleClassName("half_opacity")
>
> this doesn't works because c.node.toggleClassName("half_opacity")
> enteres enteres to  toggleClassName(element, className) function with
> first argument "half_opacity" and undefied second element. it has same
> effect as i've been calling Element.toggleClassName("asd").
> c.node.toString() returns [object SVGCircleElement]. SVGCircleElement
> inherits SVGElement, wich has Element as "Superinterface".
> I tried Object.extend(c.node, Element), but it doesn't make sence.
>
> I liked to use Raphael in my work, using it with Prototype will brings
> more facilities.
> One more question - is there any svg library wich supports prototype?

--

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.


Reply via email to