javascript - Drawing a covering rect on mouseover on a svg -


i mark area active highlighting new rect.

function coverrect(el){     var x=el.x.animval.value;     var y=el.y.animval.value;     var width=el.width.animval.value;     var height=el.height.animval.value;     var svg   = document.documentelement;     var svgns = svg.namespaceuri;     var rect = document.createelementns(svgns,'rect');     rect.setattribute('x',x);     rect.setattribute('y',y);     rect.setattribute('width',width);     rect.setattribute('height',height);     rect.setattribute('fill','yellow');     svg.appendchild(rect); }  var el = document.getelementbyid('ef-vr1'); el.addeventlistener('mouseover', function(){     coverrect(el); }, false); 

the rect correctly displayed not on rect on pass mouse over. alter alpha of rect in order show below, , pass click being intercepted underlaying rect.

i managed issue changing cursor.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -