am wanting to pass the value of screen width or media query to Stash variable so I can then use that variable to load either the small or large version of a Channel Image.
Tried a few things including the following but assigning an ID to the stash expression doesn’t work.
[removed] var w = window.innerWidth; var x = document.getElementById(“demo”); x[removed] = w ; [removed]
{exp:stash:set name="foo" id="demo"}{/exp:stash:set} {exp:stash:get name="foo"}
This doesn’t answer your question directly but have you thought about using responsive images which does the same thing using the native HTML IMG SRCSET parameter?
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
That would allow you specify various image sizes so the browser chooses the most appropriate based on viewport size.
A brilliantly simple idea executed with charm and playfulness. Fall Guys offers a joyous escape and a reminder that games can be fun first and foremost.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.