Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Screen resolution to determine respondent device

How can we detect the screen size (as you do with mobile CSS style sheet) so that we can determine the device type?

I understand Sawtooth activates the mobile CSS style sheet when the screen resolution is less than 600 pixels wide.

Can we as programmers use this technique (or something similar) to enable us to define the device type?

Or is it possible to include a screen resolution function that returns the pixel width?

It would be handy to also define pixel width ranges that reflect the devices.
asked Feb 13, 2015 by Paul Moon Platinum (98,670 points)
retagged Feb 13, 2015 by Walter Williams

1 Answer

0 votes
screenWidth = $(window).width();

(or for conditional CSS there is the CSS# @media query)

If you want to record it or use in skip logic I would recommend the mobileESP JavaScript library for this though. Not perfect, but can easily detect whole classes of device types and save them to a free format variable.

After including the library just need something like..

var isTablet = MobileEsp.DetectTierTablet();
document.getElementById("myfreeformat_tablet").value  = isTablet;

http://blog.mobileesp.com/
https://code.google.com/p/mobileesp/source/browse/JavaScript/mdetect.js
answered Feb 13, 2015 by Nolan Kaplan Bronze (4,090 points)
Thanks for the reply Nolan. Appreciated.

You would have to know your JavaScript to follow the syntax here.

I would love to see Sawtooth throw in a function (not sure how difficult it would be) like ScreenRes() like some of the other system SSI Script functions?
...