Detecting screen resolution in javascript?
Anybody know how to detect screen resolution in javascript?
From looking about the web I've found that for web programming purposes you can use the "screen" object (screen.width, screen.height etc) but this does not appear to work in the max js object.
Any suggestions?
Cheers,
David
PS appologies for double posting - accidentally replied to a related post which I didn't realise was in the jitter forum - hence the re-post here.
Not sure if you can do it in js, but you can always just use the jit.displays object, and send the info into your js.
Yeah, I probably will have to do that, but I was hoping there would be a simpler way - there will be timing implications in my programme if i have to do it outside js - and that always makes my brain hurt.
Thanks anyway.
David
Just use [screensize] at loadbang to send the data to your js, and store it there for re-use?
Or are you hoping to detect screen resolution changes made by the user?
Nope, not planning on detecting a changing screen resolution. Using [screensize] is already my plan B, and is looking more and more like my only option.
In fact, hang it all, that's what I'm going to do.
I'm a little surprised, though, that js doesn't work with all standard javascript web objects... oh well, you can't have everything.
THanks for all the advice.
D