DigitalCharlie
DigitalCharlie
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
Ah, makes sense. I was positioning the SVG exactly under the grid I setup, trying to make the offset from the parent elements the same as what it needs to be for the svg
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
last question — is using startElementRect just a little easier than using offset math? I'm guessing both work, just trying to make sure I'm also learning/understanding why different choices are better/worse/different
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
Thank you so much! It's working now (I haven't done all 3 yet, but the first is working)
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
Got it. I had just been thinking about writing one function that updates and hard coding them in, then running the function on page load and on resize.
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
is there a good reason to fully generate it with JS vs putting the elements in the HTML and then updating them?
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
Thank you! I had started working a bunch of this out, but was stuck at setting the points because I couldn't get it to actually set properly
27 replies
KPCKevin Powell - Community
Created by DigitalCharlie on 10/3/2024 in #front-end
Creating a triangle connecting a div and a point on an image
I could do it either way — I was thinking about having them be part of the image just to guarantee they're anchored correctly no matter what, but if they're actual elements it would let people click on them which might be good. I haven't done much with SVGs (yet). Do you have a resource you might recommend I look at to start?
27 replies