A problem that comes up periodically is that people want to know the position of Html elements on the page after they've been laid out, for example so they can:
- Absolutely position an element based on the position of one or more relatively-positioned elements. E.g:
- make a popup seem to "come out of" a certain element (this could be done by adding a child of the div which is positioned relative to it, but is easier if you can just get the laid-out coordinates of the div and position the popup relative to that)
- draw a circle around an element, to highlight it (e.g. for a first-time app walkthrough tutorial). Again, maybe possible to do with purely relative layout, but much easier if you can get element position.
- draw a line between two page elements
- know whether an element is visible, given the current scroll window
- get mouse events on an element which are relative to that element's top-left origin (e.g. for a mouse-interactive Graphics.Collage embedded in HTML)
Elm-html cannot t