I have an SVG object which consists of multiple paths. For each of these paths, a JavaScript function is attached to the "onmouseout" event. This is shown below:
<path id="AUK" style="fill:#00A600;" onmouseover="m_over(this.id);" onmouseout="m_out(this.id);" d="M142.3397,326l-8.66,-15l8.66,-15h17.32l8.66,15l-8.66,15H142.3397z"/>
When the user hovers their mouse over this element, the opacity is set to 0.3 (function not shown). When the user's mouse leaves this element, the opacity is reset to 1.0. The function that achieves this is shown below:
function m_out(hover_id) {
document.getElementById(hover_id).setAttribute("fill-opacity", "1.0"); }
I want to fade (or animate ) the opacity from 0.3 to 1.0 over 1 second. Currently this transition occurs (almost) instantly.
Ideally, I would like to achieve this using code similar to whats listed above.
Where should I start...?