lundi 23 mars 2020

How can I click svg line tag having more boundaries?

I'm every day thanks to answering developer. How can I click svg line tag having more boundaries?

This is my line tag. enter image description here

This is I want click ling tag boundary. enter image description here

  <body>
    <svg height="210" width="500">
      <defs>
        <filter id="f1" x="0" y="0" width="200%" height="200%">
          <feOffset result="offOut" in="SourceGraphic" dx="2" dy="2" />
          <feBlend in="SourceGraphic" in2="offOut" mode="normal" />
        </filter>
      </defs>
      <line
        x1="0"
        y1="0"
        x2="200"
        y2="200"
        style="stroke:rgb(255,0,0);stroke-width:5;box-shadow: 10px 5px 5px red;"
      ></line>
    </svg>
  </body>
  <script>
    document
      .getElementsByTagName("line")[0]
      .addEventListener("click", function(e) {
        console.log("lineClick", e);
      });
  </script>

How Can I click event boundary set more?




Aucun commentaire:

Enregistrer un commentaire