也许这是一个浏览器错误。如果该元素是事件元素的子元素并且允许事件传播,则该元素的突然鼠标块不应触发 mouseup。
fill-opacity
您可以通过操作而不是解决此问题visibility
:
//remove .setAttribute('visiblity', ...)
onmousedown="getElementById('flash').setAttribute('fill-opacity',1)"
onmouseup="getElementById('flash').setAttribute('fill-opacity',0)"
而你的#flash
元素...
<!--Removed visibility="hidden" added fill-opacity="1" and removed fill-opacity:0 from styles -->
<path
style="fill:url(#radialGradient3033);fill-rule:nonzero;stroke:#ffffff;stroke-width:1.2529794;stroke-opacity:0"
d="M 423.65326,432.06998 C 405.51096,436.96285 390.19952,445.00107 368.27826,447.66373 362.06308,452.02659 356.97847,456.99773 353.34076,462.22623 L 353.34076,496.06998 C 359.10138,502.25487 368.35017,506.24285 379.40326,507.60123 401.52711,502.8051 417.56662,493.26432 440.49701,490.66373 445.27742,487.01892 449.28524,482.98308 452.37201,478.78873 L 452.37201,443.19498 C 445.96886,436.83241 435.72653,432.94392 423.65326,432.06998 z"
id="flash"
inkscape:connector-curvature="0"
fill-opacity="1"
/>