Static GitHub Issues

[2513] Event before resources. DOMContentLoaded ?

prev: Using srcset and the path shortcut feature
next: document.body.scrollTop always returns 0 in Safari

Hi!

I want to adjust images setting on the client side. I cannot do it on server side because I do not know client screen resolution.

The problem is that both mounted() and window.onNuxtReady are triggered after all resources were loaded. Which is too late for me.

I guess I should use DOMContentLoaded but I am not sure how to do this with nuxt.

I need to tweak the images styles before the images are loaded to avoid content shifting on devices with slow connection.

Any suggestions? Thanks!

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2183">#c2183</a>)</em></sub></div>