SVG事件监听器用法示例

在SVG中, 你可以将各种事件侦听器直接添加到SVG形状中。

例:

<!DOCTYPE html>
<html>
<body>
<svg width="500" height="150">

<rect x="10" y="10" width="100" height="75"
   style="stroke: black; fill: silver; fill-opacity: .4;"
   onmouseover="this.style.stroke = 'blue'; this.style['stroke-width'] = 5;"
   onmouseout="this.style.stroke = 'green'; this.style['stroke-width'] = 1;"/>

</svg>
</body>
</html>

立即测试

转换坐标系

使用transform属性, 可以将图形移动到新位置。你还可以旋转或缩放图形。你必须将transform属性添加到适当的SVG元素中才能转换坐标系。

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_46659.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?