鉴于这种:
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100px" height="100px" version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<text
x="20"
y="20"
onload="alert('load'); setAttribute('fill', 'fuchsia')"
onclick="setAttribute('fill', 'lightgreen')"
onmouseout="setAttribute('fill', 'black')"
>Load me</text>
</svg>
Run Code Online (Sandbox Code Playgroud)
当svg打开时,我希望看到粉红色的文字.onclick和onmouseout按预期工作.
这在firefox中不会发生.IE无法打开它,期间.
有什么解释吗?
这对我有用
//snip...
<svg width="100px" height="100px" version="1.1" onload="alert('load'); setAttribute('fill', 'fuchsia')"
xmlns="http://www.w3.org/2000/svg"
>
//snip...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16578 次 |
| 最近记录: |