我有一个图像上的动画,在2秒后淡入图像,并使用填充=“冻结”完成动画后可见的图像。使用javascript设置不透明度时使用冻结
动画按预期工作。
如何在冻结设置时通过javascript更改不透明度?现在我不能在脚本中改变不透明度。如果我删除冻结我的脚本工作,但由于预期的动画不工作了(然后将图像获取无形完成结束后)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript" >
window.onload = function() {
img1.addEventListener("click", clickImg);
};
function clickImg(event)
{
event.target.setAttribute("opacity",'0');
}
</script>
<svg id="svg1" xmlns="http://www.w3.org/2000/svg" version="1.1" >
<image x="25%" y="25%" width="30%" height="30%" id="img1"
opacity="0"
preserveAspectRatio="xMinYMin meet"
xlink:href="img/3dugs.jpg" >
<animate attributeName="opacity"
fill="freeze"
attributeType="CSS"
begin="2s" dur="2s" from="0" to="1"
repeatCount="1" />
</image>
</svg>
</body>
</html>
究竟是什么,你希望当图像应该发生点击? –
它应该隐形 –