JavaScript and SVG: how do you increase the clickable area for an onClick event?

后端 未结 2 1811
难免孤独
难免孤独 2021-01-12 04:09

My script draws lines on the screen at a stroke-width of 3. The size of lines are ideal (visually) but they aren\'t very easy to click.

As a rough example:

2条回答
  •  悲哀的现实
    2021-01-12 04:18

    A variation on the above answer. For a cool selection effect group each thin line and transparent line combo in a group with the thin line on top. Set the onclick to the group and then animate the transparency of the thick line in your onclick.

提交回复
热议问题