24 lines
620 B
XML
24 lines
620 B
XML
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<rect id="rect" width="100" height="100" fill="red" />
|
|
<svg onclick="hit()">
|
|
</svg>
|
|
<script>
|
|
<![CDATA[
|
|
var hitDetected = 0;
|
|
function hit() {
|
|
hitDetected = 1;
|
|
}
|
|
|
|
if (window.eventSender) {
|
|
eventSender.mouseMoveTo(200, 200);
|
|
eventSender.mouseDown();
|
|
eventSender.mouseUp();
|
|
|
|
if (hitDetected == 0) {
|
|
document.getElementById('rect').style.fill = 'green';
|
|
}
|
|
}
|
|
]]>
|
|
</script>
|
|
</svg>
|