mobile

How do I determine whether it's a mobile device with PHP?

萝らか妹 提交于 2019-12-17 10:33:07
问题 I am writing a website with PHP. Since it will need to be accessed by anyone on the network to access the internet I have to create a mobile version. How do I best check if it's a mobile device? I don't want to have a switch statement with 50 devices at the end since I don't only want to support the iPhone. Is there a PHP class I could use? 回答1: You need to check several headers that the client sends, such as USER_AGENT and HTTP_ACCEPT. Check out this article for a comprehensive detection

Mobile web: how to get physical pixel size?

穿精又带淫゛_ 提交于 2019-12-17 09:47:56
问题 I am creating a web app using jQuery Mobile and PhoneGap. There is a graph and if the user is using a large screen, I would like to display more points on this graph, because points are tappable and the shouldn't be too close (physically). For example: if someone has an iPhone, I want to display N points on the line graph. If he has an iPad, i want to display 2xN points (cause iPad has physically larger screen), but if he has some newer Android phone that is physically small like an iPhone

Responsive order confirmation emails for mobile devices?

别来无恙 提交于 2019-12-17 07:41:21
问题 I've never seen an amazing order confirmation / invoice email. Even the best html5 websites send terrible order confirmation emails (sometimes in plain text). I believe this is because invoice's usually require the use of tables to show the purchased items, which is extremely hard to implement on a mobile devices. I found some tricks to making tables more manageable on mobiles: http://css-tricks.com/examples/ResponsiveTables/responsive.php, but for an order confirmation email, this approach

jQuery: keyup event for mobile device

浪尽此生 提交于 2019-12-17 06:53:58
问题 I'm having a few issues getting a keyup event to fire on my iPhone, my code is as follows: var passwordArray = ["word", "test", "hello", "another", "here"]; var test = document.getElementById('enter-password'); test.addEventListener('keyup', function(e) { if (jQuery.inArray(this.value, passwordArray) != -1) { alert("THIS IS WORKING"); } else {} }); The idea being that as the user is typing into the #enter-password field, as and when they've matched a word in the passwordArray the alert will

Android Custom Event Listener

ぃ、小莉子 提交于 2019-12-17 06:24:09
问题 Say I want to make my own event listener for my class, how do I do that? Do I need to maintain a thread manually? 回答1: public class CustomView extends View(){ OnCustomEventListener mListener; : ://some code : : Create an interface that will be implemented by your activity: public interface OnCustomEventListener { void onEvent(); } public void setCustomEventListener(OnCustomEventListener eventListener) { mListener = eventListener; } Now you need to know when the event is actually occurring.

What is the best method of re-rendering a web page on orientation change?

给你一囗甜甜゛ 提交于 2019-12-17 05:51:33
问题 I have a fluid CSS layout which is rendering badly on an iphone when I change the orientation. (It looks fine when it is refreshed). I am using the code below to refresh the page on orientation change, which works fine - it just feels a little wrong doing so. Is there any way of achieving this without having to reload the entire page? It is a mobile site, I don't really want to force the user to load the page twice. var supportsOrientationChange = "onorientationchange" in window,

What is the best method of re-rendering a web page on orientation change?

无人久伴 提交于 2019-12-17 05:51:26
问题 I have a fluid CSS layout which is rendering badly on an iphone when I change the orientation. (It looks fine when it is refreshed). I am using the code below to refresh the page on orientation change, which works fine - it just feels a little wrong doing so. Is there any way of achieving this without having to reload the entire page? It is a mobile site, I don't really want to force the user to load the page twice. var supportsOrientationChange = "onorientationchange" in window,

JavaScript how to check User Agent for Mobile/Tablet

末鹿安然 提交于 2019-12-17 05:04:21
问题 I'm currently developing some JS work for a clients website which has different functionality across desktop and tablet platforms. Consider: if(! navigator.userAgent.match(/Android/i) && ! navigator.userAgent.match(/webOS/i) && ! navigator.userAgent.match(/iPhone/i) && ! navigator.userAgent.match(/iPod/i) && ! navigator.userAgent.match(/iPad/i) && ! navigator.userAgent.match(/Blackberry/i) ) { // do desktop stuff } else if ( navigator.userAgent.match(/iPad/i) ) { // do tablet stuff }

Auto height on parent container with Absolute/Fixed Children

喜欢而已 提交于 2019-12-17 04:30:55
问题 Im trying to set an automatic height a div that contains 2 child elements, positioned fixed and absolutely respecitvely. I want my parent container to have an auto height but I know this is hard as the child elements are taken out of the page structure with their positions. I have tried setting a height to my parent div that works, but with my layout being responsive, when its scaled down to mobile, the height remains the same where as the content within becomes stacked and so the height

Way to do content adaptation to mobile

╄→гoц情女王★ 提交于 2019-12-17 04:07:11
问题 I creating a site and want turn it mobile ready, i see people talking about very very old technology but everything looks walking to an web mobile experience I see people talking about frameworks] to mobile web development, also a friend told me about (wurfl)('http://wurfl.sourceforge.net/java/wall.php) to detect mobile features and build an apropriate css file doing content adaptation. I see people defining three or four css files and using media queries to match device by screen size with