Menu

Out With the JS, In With the HTML
📰
0

Out With the JS, In With the HTML

blog.jim-nielsen.com·Jim Nielsen·22 days ago
#1Pxx6u7O
Reading 0:00
15s threshold

I’ve been posting about how you can make lots of HTML pages and leverage navigations over in-page, JS-dependent interactions . Now I’m gonna post another example. On my icon sites, I have a little widget that allows you to resize the icons you’re looking at. Previously, I implemented this functionality as a web component that looked something like this: < icon-list size = "md" > < a href = "" > < img src = "" width = "128" height = "128" /> </ a > < a href = "" > < img src = "" width = "128" height = "128" /> </ a > <!-- more --> </ icon-list > The size attribute corresponded to an enumeration like sm | md | lg | xl which mapped to actual pixel dimensions like 64×64 or 512×512. When the little widget was clicked to render icons at a different size, JavaScript changed the size attribute on the <icon-list> custom element.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More