I read in the documentation raphaeljs description of Set.forEach, and can't understand how it works. Please can anyone give me an example of usage.
Here you have a working example:
And this is the important part of It:
set.forEach(function(e){
e.attr({fill:'#000'})
})
Its a little bit tricky at first, but its pretty handy when you get it. You need to pass to the forEach()
method the function that you want to execute on each element, and this function need to have, like an argument, a variable name to bind to the element. So in this case e
is the rectangle that is being processed. Got it?