Hi all,
Just getting some css together for a mobile web app (using the xhtml-basic/xhtml-basic11 dtd) and was trying to think of a reliable way to filter for mobile browsers. I've taken a look at http://detectmobilebrowser.com but that appears to filter on the basis of a list of string matches.
Here's what I'd like to do:
1 - In the css, set the parts of the page to hide from mobile browsers to not display
#hideMeFromMobiles{display:none;}
2 - Call a script using a reliable library that is pretty much certain to fail in mobile browsers. The script does something like this (pseudocode)
if browser.window.width >= 480px then {
$(#hideMeFromMobiles).addStyle(display:block;)
}
The idea is for the script to fail non-destructively on mobile browsers and run succesfully in desktop web browsers.
My question is this:
Firstly will this work? Is there some reason this is a dead-end and I should move to another solution?
And secondly, could someone confirm the correct jQuery syntax?
Thanks for your help, Dug