Note that there are some explanatory texts on larger screens.

plurals
  1. POWatching the offset of an element in the dom, when a different element changes?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWhat have you tried with the `MutationObserver` so far, as this should trigger when attributes are altered. It might not get you the whole way there but it could possibly help -- unless it doesn't trigger on style changes. I've not actually checked that myself.
      singulars
    2. COOk just checked, `MutationObservers` do fire for a style attribute change (at least in FireFox).. but it doesn't tell which property was altered. still useful tho. This wont help with reacting if other elements (or if the window) shift(s) dimensions however. For that you will definitely need an interval/timeout checker and a window resize event listener... unless someone out there knows of js methods that allow you to hook into the user agents rendering process?
      singulars
    3. COExactly the same problem I experienced. It was quite easy to catch in-line style changes that might affect the offset of another item, but if there is a class change in the dom that changes the offset of the item to be watched a `MutationObserver` will only tell that a class has been added. I think I will add a mutation observer to just catch any changes, then do a manual `if offset.top != old_offset.top`. At least it's better than using timers.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload