Main Board > iNomads

Screen Size

(1/2) > >>

Hi everyone!  using inomads is there any way to calculate the screen size of the device that is being used?, in nomads we usually use MSE to calculate the dimensions but apparently it doesn't work in inomads.

Mike King:
When using iNomads, and in fact when developing web applications, screen size is dynamic since on desktops it depends on the size of the browser window and on tablets it depends on the screen orientation.

That being said you can use the js_eval method to pass a JavaScript request for the device size .. but whatever value you get can change at any time.

Mike King:
To save you from looking up the JavaScript the following would give you the window size in pixels:

    %inomads'js_eval$("window.innerWidth +'/' + window.innerHeight")

It will return a string consisting of the width and height separated by a "/".

Thanks for reply, I did a test with that code and returns an <err>.

Mike King:
Make sure you have the case right.

I tested it on my system first and it ran fine using chrome


[0] Message Index

[#] Next page

Go to full version