-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
✨ enhancementNew feature or requestNew feature or request
Description
It would be great to be able to run JS (execute) between each width. Currently I am using the execute ability to scroll to the bottom of the page in order to trigger lazily loaded images. However since execute runs only once after the last width is set, the only images that are loaded are those requested by the last width. Instead it would be good to be able to either declaratively scroll to the bottom or more generally run JS between width changes.
This is the JS code that I am running:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
window.scrollTo({ top: document.body.scrollHeight, behavior: "smooth" });
await sleep(2000);
window.scrollTo(0,0);
await sleep(5000);This comes up when using a srcset with any sort of lazy loading behavior.
The current flow is:
set initial width
go to page
iterate over widths, ending on the last one
wait for any specified timeout
wait for any specified selector
execute any javascript
wait for network
This issue comes up for example on any pages using next.js' next/image.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
✨ enhancementNew feature or requestNew feature or request