mobile-website

Detecting Requests from Mobile Browsers in ASP.NET [duplicate]

一曲冷凌霜 提交于 2019-11-29 20:53:39
问题 This question already has an answer here: Mobile Device Detection in asp.net 8 answers I have an existing web site and I would like to create a mobile version of it that is more suitable. For instance, the main site uses drop-down menus and we all know those are quite the fail on mobile devices. I would like to redirect to my mobile version (it will be a subdomain of the current site) if I detect a request from a mobile browser. So when they Google something and come to my site, they will

Disable Pinch Zoom on Mobile Web

徘徊边缘 提交于 2019-11-29 19:35:14
I want to disable Pinch and Zoom on Mobile devices. What configuration should I add to the viewport ? Link : http://play.mink7.com/n/dawn/ EDIT: Because this keeps getting commented on, we all know that we shouldn't do this. The question was how do I do it, not should I do it. Add this into your for mobile devices. Then do your widths in percentages and you'll be fine: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> Add this in for devices that can't use viewport too: <meta name="HandheldFriendly" content="true" /> This is all I

Detect mobile devices with Django and Python 3

时光毁灭记忆、已成空白 提交于 2019-11-29 12:01:17
问题 I am struggling to find an easy way to detect if the request comes from a mobile device in my Django views. I am trying to implement something like this: #views.py def myfunction(request): ... if request.mobile: is_mobile = True else: is_mobile = False context = { ... , 'is_mobile': is_mobile, } return render(request, 'mytemplate.html', context) And in mytemplate.html : {% if is_mobile %} show something {% else %} show something else {% endif %} Everywhere I checked (for instance here or here

How to start the camera directly from a web page in android

这一生的挚爱 提交于 2019-11-29 10:54:15
Im trying to make a webapp for Android in which i can upload pictures. I have a web page with a fileupload field. When I push the button I can choose which app i would like to use to choose the file to upload. Is it posible (and how) to have the camera app in this list? Or do I maybe need a special app for this? Thanks in advance! Here is the code to get access to the new camera api's in android 3+ and iOS 6. <input type="file" accept="image/*" capture="camera"> This will allow you to take a new picture or select one from the device library and then upload it to a web app. Check out PhoneGap .

Mobile Web - Things to consider?

一曲冷凌霜 提交于 2019-11-29 10:21:12
问题 So I am creating my first webpage catered to mobile browsers. What are some things to consider? How do I get the resolution right for different devices (Blackberries, iPhones, iPads, etc.)? Is there a common method that people are using? Some sort of framework? How do I prevent zooming (on most touch screen phones, you can zoom in by pinching)? What are some other things to keep in mind? 回答1: There are a ton of good practices to follow. Here are a few: make the content shorter and easier to

Trying to implement Google's Fast Button

ⅰ亾dé卋堺 提交于 2019-11-29 07:26:13
问题 I'm trying to implement Google's Fast button for the mobile touch events, and I seem to be stuck. I'm trying to set it up so that I can make links into fastbuttons, but I can't seem to get my library structure right. What ends up happening is the fastbutton re-inits itself when I try to run a for loop on the links. I'm sure it's just the way i'm setting up the library. can someone please check it out? Thanks! http://code.google.com/mobile/articles/fast_buttons.html ;(function() { /*Construct

How to target Galaxy Nexus and Nexus 7 with media queries?

允我心安 提交于 2019-11-29 06:40:42
问题 I have two devices that I'm testing site design with. Samsung Galaxy Nexus and Asus Nexus 7 tablet. I'm having a really hard time figuring out how to target these individual devices with media queries. I'm not sure about what values to use for max-width or to use max-device-width . Also I can't figure out what order to put the media queries in... According to: http://responsejs.com/labs/dimensions/ Galaxy Nexus Portrait: document.documentElement.clientWidth = 360 Galaxy Nexus Landscape:

Hide address bar in mobile device browser

☆樱花仙子☆ 提交于 2019-11-29 05:17:24
问题 I know 1 way of doing this. <body onload="setTimeout(function() {window.scrollTo(0, 1)}, 100)"> ... </body> But this works only if the page is big enough to be scrolled. If the page fits the screen the above function wont work. How to hide the address bar in this case ? I need to get it to work with iphone, ipad, android devices. 回答1: Maybe you can set the minheight on the body bigger. 480px screen height in vertical mode + 60px address bar height = 540px. Example: body { min-height:540px; }

Mobile CSS Page width

天大地大妈咪最大 提交于 2019-11-29 03:24:53
Trying pretty hard to make simple form page viewable in mobile devices. The form is viewable, just that I have to zoom in a lot to read it. Hear is an example: http://200.5.3.20/temp/PocketPC/dispatch.php jonezy You can add the meta viewport tag that will scale the page to the device width: <meta name="viewport" content="width=device-width, initial-scale=1.0"> You can read up on it here too . Apart what jonezy used, meta viewport tag as below will also work: <meta name="viewport" content="width=device-width, user-scalable=no"> It will not be scalable and fit to device width - for any device,

How to scale a website for mobile devices?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 02:31:28
问题 I've a very simple static web page (only css and links, no scripts). It looks good on android and iphone, but too small. I'm guessing they put it smaller since it work for most of the sites. How can I override this and make him look the size I want it to be? 回答1: Android automatically adjusts to the size of your site, try to use width:100% or smaller than around 310 pixels (scrollbar takes space) for normal viewmode. For IPhone try using this code to force the correct size <meta name=