jktjktjkt
August 18th, 2008, 03:48 AM
Hey all,
Is anyone able to tell me how I set a text to animate from hidden to visible when I mouseover a different ‘rect’ element not containing this text? The text and the associated animation are in one function, and the ‘rect’ element is created from a generic rect-creating function and then called in another main-box function.
Currently, the animation code looks like this:
var anim = SVGDoc.createElementNS('http://www.w3.org/2000/svg', 'animate');
anim.setAttributeNS(null,'attributeName',"visibility");
anim.setAttributeNS(null,'begin', "0s");
anim.setAttributeNS(null,'dur',"1s");
anim.setAttributeNS(null,'fill',"freeze");
anim.setAttributeNS(null,'from', "hidden");
anim.setAttributeNS(null,'to', "visible");
infoText.appendChild(anim);
Obviously I need to change the ‘begin’ attribute and add an ‘end’ attribute, but I don’t know to what… I’m guessing that getElementById will help, and I’ve tried several different ways of implementing this and the associated variable, but to no avail. Can anyone help me please?
Thank you.
Is anyone able to tell me how I set a text to animate from hidden to visible when I mouseover a different ‘rect’ element not containing this text? The text and the associated animation are in one function, and the ‘rect’ element is created from a generic rect-creating function and then called in another main-box function.
Currently, the animation code looks like this:
var anim = SVGDoc.createElementNS('http://www.w3.org/2000/svg', 'animate');
anim.setAttributeNS(null,'attributeName',"visibility");
anim.setAttributeNS(null,'begin', "0s");
anim.setAttributeNS(null,'dur',"1s");
anim.setAttributeNS(null,'fill',"freeze");
anim.setAttributeNS(null,'from', "hidden");
anim.setAttributeNS(null,'to', "visible");
infoText.appendChild(anim);
Obviously I need to change the ‘begin’ attribute and add an ‘end’ attribute, but I don’t know to what… I’m guessing that getElementById will help, and I’ve tried several different ways of implementing this and the associated variable, but to no avail. Can anyone help me please?
Thank you.