NetTalk Central

Author Topic: Detect small screen?  (Read 3377 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Detect small screen?
« 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

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Detect small screen?
« Reply #1 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

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Detect small screen?
« Reply #2 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


Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Detect small screen?
« Reply #3 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.

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Detect small screen?
« Reply #4 on: January 09, 2024, 10:43:06 AM »
Ok noted  :)

/Poul

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Detect small screen?
« Reply #5 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Detect small screen?
« Reply #6 on: January 09, 2024, 08:36:02 PM »
Use CSS - @media

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Detect small screen?
« Reply #7 on: January 10, 2024, 02:33:18 AM »
Thanks guys.