mobile-safari

HTML button tag does not word-wrap on iPhone/iPad

时光怂恿深爱的人放手 提交于 2019-12-11 12:22:42
问题 I am having trouble getting the <button> element to render correctly on the iPhone/iPad. Here is the sample: <button type="button" style="width:150px; word-wrap:break-word;">some very long text to make it wrap and go to another line</button>; The idea is to have a fixed width button and the text wraps as needed. In newest IE, FF, and even desktop Safari (Mac and PC) things work as expected. The button width is fixed, the text wraps, and the button height automatically is increased to show the

cursor out of control in textarea on IOS8 safari

╄→гoц情女王★ 提交于 2019-12-11 10:27:28
问题 cursor is not in textarea when user input long text or input some enter. This only happens on IOS8. see attachment. 回答1: find a wordaround to resolve the problem. textarea.addEventListener('scroll', function(evt){ evt = evt || window.evt; evt.target.setSelectionRange(evt.target.textLength - 1, evt.target.textLength - 1); setTimeout(function(){ evt.target.setSelectionRange(evt.target.textLength, evt.target.textLength); }, 0); }); 来源: https://stackoverflow.com/questions/31376906/cursor-out-of

Preventing unwanted redirects from browser to app store

不羁岁月 提交于 2019-12-11 10:06:25
问题 I've been working on a redirect page that sits between an ad and the app store. The ad exists as a static URL that directs to the redirect page. The redirect page sends an ajax request to a third party, sets a cookie, then redirects to the AppStore. All well and good and not uncommon. The redirect page cannot close itself so it remains as a tab in Safari. The issue I'm having is that when the user returns to Safari if the page is been purged from the cache, Safari will reload it triggering

-webkit-overflow-scrolling: touch, large content gets cut off when specifying a width

这一生的挚爱 提交于 2019-12-11 09:39:25
问题 Large content like a table with thousands of row was getting cut off when put inside a scrollable div (see css, ios, iPad, -webkit-overflow-scrolling: touch bug, large content gets cut off) <div class="longList"> <!-- table with thousands of rows --> </div> css: .longList {overflow: auto; height: 550px; margin: 0 auto; -webkit-overflow-scrolling: touch;} I solved this following http://johanbrook.com/browsers/native-momentum-scrolling-ios-5/ after some research. So, adding position:fixed

How to center 'Getting Data' on mobile screen

好久不见. 提交于 2019-12-11 08:11:53
问题 While developing a site for many browsers, mobile and desktop, I've noticed that the following CSS works nicely to center a loading div. img.loading1 { position:absolute; left:50%; margin-left:-16px; top:50%; margin-top:-16px; z-index:10 } .loading2 { color:#006BB2; position:absolute; left:50%; margin-left:0px; top:40%; z-index:5 } .loading3 { position:absolute; width:100%; height:100%; left:0; top:0; background-color:lightgrey; opacity:0.85 } <div id="container" style="position:relative"> ..

iPhone / IOS No Audio Interruption Ended after playing video in Safari

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:56:58
问题 V4.x We have an app that is recording audio in the background. No problem. 1) Phone call comes in 2) App gets Audio Interruption Event 3) Phone Call ends 4) App gets Audio Interruption Ended Event 5) We popup a Local Notification to restart 6) User says ok 7) We come to front and start the recorder But when someone plays a video in say Safari 1) User plays video in Safari 2) App gets Audio Interruption Event 3) Video Ends / User stops / ends Safari 4) NO Audio Interruption Event. Anyone else

Can't find variable: Promise on iOS 7

醉酒当歌 提交于 2019-12-11 05:18:55
问题 iOS 7 Safari is reporting the error Can't find variable: Promise : new Promise(function(resolve, reject) { . . . White other browsers don't have this issue, I found this similar question where Robert gave a solution to add new Ember.RSVP.Promise instead of the new Promise . My problem is that I'm not using jQuery and that makes all browsers return an error that Ember is not defined, and I found that adding Ember.min.js solves the issue, but that adds extra 129.96 KB to my page which is not

Safari: SyntaxError: Use of reserved word 'class'

坚强是说给别人听的谎言 提交于 2019-12-11 05:18:21
问题 I am trying to fit my website to all well known browsers In all browsers my JavaScript code is working, but not in Safari. I get next error in Safari: "SyntaxError: Use of reserved word 'class'" my code is look like: class _MontInit { constructor() {} sendXMLHTTPRequest(url, data, method, callback, error) { var xmlHTTP = new XMLHttpRequest(); // new HttpRequest instance xmlHTTP.open(method, url); xmlHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');

how to get a full page web app even in safari?

那年仲夏 提交于 2019-12-11 05:07:38
问题 I'm building a full-page web app and it works beautifully in chrome, but in safari mobile it goes wonky. This is because safari mobile has the navigation bar on top and another bar on the bottom. How can I make my page account for them? I've been researching this for weeks and have tried every suggestion. I'm hoping someone here can help. How do you get the height with and without the top and bottom bars? In truth, I don't really want either bar, but as far as I know there isn't a way to get

Completely prevent iOS web app from opening link in mobile Safari, even with links containing parameters

耗尽温柔 提交于 2019-12-11 05:02:19
问题 I have found multiple solutions to prevent an iOS web app from opening normal links in mobile Safari, unfortunately they do not work for links containing parameters, e.g. href="index.php?s=example" These are still opened in mobile Safari. The shortest solution for normal links I have found thus far can be found here at stackoverflow. Maybe someone can modify that script? 回答1: Try 4 years old github gist. I used it and it works. You can use it by bower: bower install --save iosweblinks May be