TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Revisiting Image Maps

73 pointsby thm14 days ago

8 comments

chrismorgan10 days ago
&gt; <i>My first thought was to embed anchors into the external map SVG: […]</i><p>&gt; <i>This approach is problematic. Those anchors are only active when SVG is inline and don’t work with an &lt;img&gt; element.</i><p>No, this approach is fine: you just need to use &lt;object data=…&gt; instead of &lt;img src=…&gt;. &lt;object&gt; is the correct choice for embedding interactive SVG.<p>But you probably do want the SVG to be inline anyway, because it will load faster and is in this case actively the content of the page; which is the technical decision he ended up at, though perhaps for partly the wrong reason.<p>(There’s also &lt;iframe&gt;.)
评论 #43970522 未加载
ag810 days ago
wow, I used to make so many games with image maps back when I first learned HTML. One still survives: <a href="https:&#x2F;&#x2F;andrew.fi&#x2F;beowulf&#x2F;game&#x2F;" rel="nofollow">https:&#x2F;&#x2F;andrew.fi&#x2F;beowulf&#x2F;game&#x2F;</a>
评论 #43972091 未加载
评论 #43987215 未加载
评论 #43970255 未加载
seabass10 days ago
&gt; Anchors positioned absolutely over my map wouldn’t solve the pixel-based positioning problem or give me the irregular-shaped clickable areas I wanted. Anchors within an external SVG wouldn’t work either.<p>If you&#x27;re trying something like this and irregular-shaped clickable areas are not a concern (like if only the numbered circles from the article&#x27;s example would be clickable) then absolutely positioned anchors can be made to work. The trick is to use js to apply a css scale transformation to a relatively positioned parent container whenever the underlying image changes size.
评论 #43972123 未加载
danhite10 days ago
for those of you using something like their technique of opacity animating a clip-path region from one look to another upon ~click ...<p>if you wish to be visually kind to safari users you can eliminate the default gray selection indication flash animation safari does upon a tap activation with just a tiny bit of webkit-only css , for example ...<p>#links { -webkit-tap-highlight-color : transparent ; }<p>added to the css of their codepen fixes it (without causing any issues for other&#x2F;std browsers afaik)
Mr_Minderbinder9 days ago
&gt; Image maps date all the way back to HTML 3.2, where, first, server-side maps and then client-side maps defined clickable regions over an image using map and area elements.<p>Server-side image maps were specified in HTML 2.0, in section 7.6 of RFC1866.
deanc10 days ago
I&#x27;ve spent five minutes now, to no avail, trying to find a link to this website.
评论 #43973931 未加载
M95D10 days ago
This is all because of web standards playing catch-up with implementations instead of the other way around.
notarealllama10 days ago
TFA takes us on this journey and then at the end, &quot;Image maps ended up not working for us&quot; without telling us what they did. My money is on JavaScript for that &quot;expressive&quot; aspect of the hover.
评论 #43970439 未加载