How to use addEventListener for browser window resizing in web deployment?
harrison at all-auctions.com
harrison at all-auctions.com
Sat Aug 6 10:30:25 EDT 2022
Hi Andreas,
I have found the following website to be very helpful with a lot of my javascript projects.
Do you know about these guys?
https://www.w3schools.com/js/default.asp <https://www.w3schools.com/js/default.asp>
I hope that helps you.
Cheers,
Rick
> On Aug 6, 2022, at 7:44 AM, Andreas Bergendal via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Hi all,
>
> So I’ve been experimenting with web deployment with LC 10 dp 4. Now I would like my stack to be able to react to resizeStack events when the browser window is resized by the user. Or to adapt to e.g. a mobile browser screen size.
>
> For this, if I understand correctly, some javascript needs to be used. I’ve tried to piece together how to do that from these sources:
> https://livecode.com/using-the-new-web-features-in-livecode-10-dp-1/
>
> and Ali Lloyd’s cool WordLC app:
> https://alilloyd.livecodehosting.com/wordlc/wordlc.html
>
> where he uses window.addEventListener(”resize” […] etc in the html file to catch browser window resizing for the stack to react on. However, as I can’t see his LC script side of it, I fail to figure out the proper adaptation to my needs:
>
> I want my stack to get, from javascript, the impulse that the browser window has changed its width/height and what the new width/height is, in order to trigger a normal resizeStack handler to deal with that.
>
> Ideally, the javascript part of this should be included by LC in the standalone build, and I hope that’s what they plan at least when LC10 stable ships (seems logical), but in the meantime - can someone please help get the code right?
>
> /Andreas
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list