mobile-safari

How do I get scrollbars to show in Mobile Safari?

南楼画角 提交于 2019-12-17 18:27:19
问题 The jQuery time-picker plugin that I wrote uses a div as the containing block for the list of times, and on Mobile Safari there are no scrollbars to indicate that there are more available times than are visible. I know about using two fingers to scroll within the div (on the iPad at least), but that only works if the user knows that there is more content to scroll to , and there's no indication that there is. So, my question: Has anyone been able to get scrollbars to show in Mobile Safari?

Detect iPhone Browser

安稳与你 提交于 2019-12-17 18:09:27
问题 is there a script to detect, if the visitor use iphone (whatever it's browser, may iphone Safari, iPhone for Opera or etc.)? Then will shutdown some some of my JavaScript. Thanks... 回答1: searching on the net there are two common ways of achieving this. My favorite though is in PHP its just so clean? wow. :D In PHP you can write <?php function isIphone($user_agent=NULL) { if(!isset($user_agent)) { $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; } return

iOS iPad Fixed position breaks when keyboard is opened

核能气质少年 提交于 2019-12-17 17:24:49
问题 Fixed position breaks on header when I click on the "Search Form" text box field. It simply detaches from the top of the page (as it's fixed up there) and starts floating middle of the page when the virtual keyboard opens up. Normal: Broken: 回答1: I really like this solution (http://dansajin.com/2012/12/07/fix-position-fixed/). I packaged it up into a little jQuery plugin so I could: Set which parent gets the class Set which elements this applies to (don't forget "textarea" and "select"). Set

How to target iPhone 3GS AND iPhone 4 in one media query?

核能气质少年 提交于 2019-12-17 17:21:38
问题 I am trying to implement alternate layouts for both the iPad/iPhone and older iPhones as well. I have established that the best method is to use @media from the CSS3 spec. As such these are my media queries at the minute: @media screen and (max-width: 1000px) { ... } Above is for small desktop and laptop screens. @media screen and (max-width: 700px) { ... } Above is for the iPad and VERY small desktop/laptop screens. @media screen and (max-device-width: 480px) { ... } Above is for iPhone 3GS-

Javascript date parsing on Iphone

怎甘沉沦 提交于 2019-12-17 15:33:34
问题 I'm working on an offline capabable Javascript site that targets mobile devices. One such mobile device is the IPhone. I'm trying to parse a date from our REST API (a member of JSON object). I'm using Date.parse("2010-03-15 10:30:00"); This works on Android devices, however on IPhone it just gives an invalid date. How do I need to format my date string so it can be parsed by the IPhone? 回答1: Not all browsers support the same date formats. The best approach is to split the string on the

Prevent iOS mobile safari from going idle / auto-locking / sleeping?

送分小仙女□ 提交于 2019-12-17 15:16:52
问题 In an iOS app you can set application.idleTimerDisabled = YES to prevent the phone from auto locking. I need to do this in mobile safari for a game like Doodle Jump where the user may not touch the screen for an extended period of time. Is there any documented method or hack to do this? (Update) They seem to be doing it somehow in this site http://www.uncoveryourworld.com. Visit from your iphone and when you get to the buildings/street scene with music playing in the background just leave

How do I apply a stylesheet just to the iPhone (and not IE), without browser sniffing?

岁酱吖の 提交于 2019-12-17 12:08:29
问题 I’d like to apply a stylesheet exclusively to the iPhone, without doing browser sniffing (via the user-agent string) on the server or via JavaScript. I particularly don’t want Internet Explorer to apply the stylesheet. Apple’s suggested code for applying an iPhone-specific stylesheet, i.e.: <link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet"> seems to cause the stylesheet to be applied by IE 7 and 6. 回答1: Use Apple’s suggested code

UIWebView and Safari comparison

帅比萌擦擦* 提交于 2019-12-17 09:43:43
问题 Does UIWebView use the same JavaScript engine as Mobile Safari? Also, does UIWebView support all HTML5 features like Mobile Safari does? I am specifically concerned about Web SQL and Web Workers If I have an app which is written purely in HTML and JS, should I wrap it up in a UIWebView or should I have it open in Mobile Safari Are pure HTML and JS apps accepted on the Apple store? 回答1: Does UIWebView use the same JavaScript engine as Mobile Safari? UIWebView does not have the Nitro Javascript

Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)

五迷三道 提交于 2019-12-17 07:25:23
问题 For a website I want to show a custom context menu when a user "longpresses" the screen. I've created a jQuery Longclick listener in my code to show a custom context menu. The context menu is displayed, but the iPad's default context menu is also displayed! I tried to prevent this by adding a preventDefault() to the event in my listener, but this does not work: function showContextMenu(e){ e.preventDefault(); // code to show custom context menu } $("#myId").click(500, showContextMenu);

iPad Safari mobile seems to ignore z-indexing position for html5 video elements

若如初见. 提交于 2019-12-17 06:38:08
问题 I got a video element on a page that's working fine both in safari mobile and desktop. I have a seme-transparent pull-down menu that's working fine. The problem is, when the menu is over the video element, on the desktop safari i can see the video under the menu (as desired), while on the mobile version the video element stay on the foreground (ugly) no matter what i tell the css. Is there any workaround? 回答1: The issue only occurs if the video element was dynamically created. If the element