html5 svg实现不规则形状图片触发事件
<pre>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
</head>

<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" class="dds" />
</svg>
<script src="/moban/js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('.dds').on('click',function(){
$(this).attr('fill','green');
})
})
</script>
</body>

</html>
</pre>

相关文章:

  • 2021-06-06
  • 2021-11-17
  • 2022-01-18
  • 2021-06-16
  • 2021-07-25
  • 2021-11-09
  • 2022-03-06
  • 2021-11-06
猜你喜欢
  • 2021-07-25
  • 2022-12-23
  • 2021-05-22
  • 2021-10-12
  • 2021-11-21
  • 2021-11-20
相关资源
相似解决方案