svg-cursor-changes.svg   [plain text]


<svg width="100%" height="100%" viewBox="0 0 300 600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<cursor id="mycursor" x="10" y="10" xlink:href="resources/webkit-background.png"/>

<!-- Clicking this circle should result in an instant update of the cursor location of this and the next circle (tested using DOM) -->
<circle onclick="document.getElementById('mycursor').setAttribute('x', '100');" cx="80" cy="150" r="70" fill="green" cursor="url(#mycursor)"/>

<!-- Clicking this circle should result in an instant update of the cursor location of this and the previous circle (tested using SVG DOM) -->
<circle onclick="document.getElementById('mycursor').x.baseVal.value = 100;" cx="230" cy="150" r="70" fill="green" cursor="url(#mycursor)"/>

<cursor id="mycursor2" x="10" y="10" xlink:href="resources/webkit-background.png"/>
<cursor id="mycursor3" x="10" y="10" xlink:href="resources/webkit-background.png"/>

<!-- Clicking this circle should result in an instant update of the cursor location (tested using DOM) -->
<circle onclick="document.getElementById('mycursor2').setAttribute('x', '100');" cx="80" cy="310" r="70" fill="green" cursor="url(#mycursor2)"/>

<!-- Clicking this circle should result in an instant update of the cursor location (tested using SVG DOM) -->
<circle onclick="document.getElementById('mycursor3').x.baseVal.value = 100;" cx="230" cy="310" r="70" fill="green" cursor="url(#mycursor3)"/>

<cursor id="mycursor4" x="10" y="10" xlink:href="resources/apple.jpg"/>

<!-- Clicking this circle should result in an instant update of the cursor image (tested using DOM) -->
<circle onclick="document.getElementById('mycursor4').setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'resources/webkit-background.png');" cx="80" cy="470" r="70" fill="green" cursor="url(#mycursor4)"/>

<cursor id="mycursor5" x="10" y="10" xlink:href="resources/apple.jpg"/>

<!-- Clicking this circle should result in an instant update of the cursor image (tested using SVG DOM) -->
<circle onclick="document.getElementById('mycursor5').href.baseVal = 'resources/webkit-background.png';" cx="230" cy="470" r="70" fill="green" cursor="url(#mycursor5)"/>

</svg>