【发布时间】:2019-05-03 00:23:35
【问题描述】:
第 1 部分 -
所以我在 SVG 中有一堆 <circle>,我希望这些圆圈是复选框。之后我想:
第 2 部分 - 当圆圈 1(现在是一个复选框)被点击时,它被选中。但现在所有其他圈子都未选中。
这是我已经尝试过的:
第 1 部分 - 将 SVG 变成一个复选框:
<circle opacity="0.5" cx="842" cy="451.814" r="25.582" class="svg_spot" id="1" fill="#FFB60C" >
<animate attributeName="r" values="25.582; 33; 25.582" keyTimes="0; 0.5; 1" begin="0s" dur="1s" repeatCount="indefinite" calcMode="linear" />
<input type="checkbox" id="spot1" name="spot" class="common_selector spot_id" value="spot1">
</circle>
第 2 部分 -
$('input[name=spot]').click (function (){
$(this).attr('checked', true);
$('input[name=spot]').not(this).attr('checked', false);
});
感谢您的时间。非常感谢任何帮助!
【问题讨论】: