on 09-27-2016 2:26 PM
Hi,
I'm using Personas 3.0 SP3, and I'm trying to add code to detect the user's screen resolution. Actually, I'm hoping to detect the available screen area, depending on if the user's screen resolution and window size. My goal is to center objects on the screen, based on the available area.
In researching this, I keep finding references to the following code. However, when I try to use it, the value comes back as "undefined".
// 1. Check your screen size
var
screenSize, flavor;
screenSize = session.findById(
"wnd[0]"
).width;
I've played around with the supplied options for this statement, and found the following returns a value, which seems to change depending on the size of the window I run it in. However, the returned value is pretty small, so I know it's not pixels. I'm not sure if there is a way to use this code or not.
screenSize = session.findById("wnd[0]").getProperty("width");
Any thoughts on how I can determine the usable screen area? Thanks for your help!
hi jeff,
in your screen event, just use
var screen_size = width;
Using "width" which is a reserved keyword will give you the updated dimensions, rather than using user area width. And then may be you can save it in a session variable and use it.
Regards,
Sushant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.