Change object attribute following transition D3

Robkesz

New Member
I want to give an object an attribute once a transition is finished. I'm simply updating an images position as follows:\[code\]tmp.transition().duration(1000) .attr("transform", function(d) {return 'translate(' + coordinates[d].x +',' + coordinates[d].y + ')'})\[/code\]Once it finishes, I want to give the object tmp an attribute "moved" with the value "no". I tried:\[code\]tmp.transition().duration(1000) .attr("transform", function(d) {return 'translate(' + coordinates[d].x +',' + coordinates[d].y + ')'}).end('moved', 'no')\[/code\]But without success. Any tips? Thanks,
 
Back
Top