Search code examples
html5-canvaskineticjs

how to change the layer color on mouse hover using kineticjs?


Generating the map (svg path via canvas) using kineticjs.

using kineticjs plugin, map generate successfully..

Need to be highlight the layer background color on mouse hover ?

but i can able to show the alert box on mouse hover...

jsfiddle.net/prasadraja07/dqhzjnut/4/

Solution

  • Your nodes are inside layer. So you need to redraw `layer':

        pathnorthen.on('mouseout', function () {
            //alert("mouse out");
            this.fill('#00dddd');
            layer.draw();
        });
    

    http://jsfiddle.net/dqhzjnut/6/