NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Poul Jensen on January 08, 2024, 11:33:20 PM

Title: Detect small screen?
Post by: Poul Jensen on January 08, 2024, 11:33:20 PM
In other tools you can dectect whether client is on small or large screen and thus adapt the amount of information shown on a screen.
Either by hiding/unhiding fields or even calling separate procedures.

Is this possible in NT14?

tia
/Poul
Title: Re: Detect small screen?
Post by: Niels Larsen on January 09, 2024, 02:45:49 AM
Hi Poul

I'm pretty sure Bruce will answer: Use CSS - @media

Look here: https://www.w3schools.com/cssref/css3_pr_mediaquery.php
Also try to see how it's used in netweb.css under /styles

Pretty easy once you get the idea

/Niels
Title: Re: Detect small screen?
Post by: Poul Jensen on January 09, 2024, 03:20:49 AM
Hi Niels,

Thanks for the info.
So there is no way to use that or similar logic inside the app?

Cheers
/Poul

Title: Re: Detect small screen?
Post by: Niels Larsen on January 09, 2024, 05:03:16 AM
It is possible to get the current screen size from the two session values _ScreenWidth_ and _ScreenHeight_
But I think you're doing yourself a bj?rnetjeneste by following that road and you're unlikely to avoid using css anyway.
Title: Re: Detect small screen?
Post by: Poul Jensen on January 09, 2024, 10:43:06 AM
Ok noted  :)

/Poul
Title: Re: Detect small screen?
Post by: osquiabro on January 09, 2024, 04:28:34 PM
for me in login detected the size with this code

IF p_web.gsv('_screenWidth_') < 600 ! is mobile
    p_web.ssv('Loc:css',' col-xs-12')     
ELSE
    p_web.ssv('Loc:css','')
END
Title: Re: Detect small screen?
Post by: Bruce on January 09, 2024, 08:36:02 PM
Use CSS - @media
Title: Re: Detect small screen?
Post by: Poul Jensen on January 10, 2024, 02:33:18 AM
Thanks guys.