Web development for iPad: how to make safari view non-draggable - ipad

I'm making a web project that is fitted to the iPad screen. I'm trying to make it look as much like a native app as possible. It is loaded in safari or atomic browser. What I'm trying to find out is if it's possible to eliminate the drag and even the zoom functions of one of those browsers for just that site.
To rephrase, I want to make my site fixed on the screen at all times. The issue is, a user will try to hit a button and it will drag the screen.
PS. An additional question is how I can make it so images don't have the "save as" functionality if held down I tried putting a span over the images, and that worked for firefox, but not iPad safari.
If you can solve any or all of these, you would have my biggest thanks!

Turns out that there are several metatags that you can put in your js file which keep the screen fixed. Good stuff on that is here:
http://jakeboyles.com/2011/01/16/how-to-build-an-iphone-and-ipad-web-app/
As far as the "save as" issue, I don't know yet, that part of my app development hasn't been solved.

Related

Web App iOS swipe to see previous page

I just added a web app manifest to my web app in order to have a better mobile experience.
When I now add my web app to my iOS home screen everything looks just like a real app, but unfortunately right and left swipe to jump to the previous seen page is not working anymore. It seems to be disabled.
Is there a way to enable this again?
When running the web app in safari the swipe gesture works just fine.
In my web app manifest I have
"display": "standalone" set.
I do not want to show the browser controls, it is supposed to look like a real app.
Is there a way to have the swiping enabled anyways again?
Thanks in advance!
Best regards
Chris
I never remember having this, but check out Framework7.io, they can do that with their framework 😀

iPhone web application : the virtual keyboard opens unexpectedly

I am having a very weird issue on an iPhone and I would like to have suggestions on the best way to troubleshoot. My web application works fine for a moment then suddenly all text fields and buttons will have no effect, but only to open the virtual keyboard.
For example, a "delete" button which used to display a "yes/Cancel" modal will only make the keyboard open, the modal won't show up... When I reload the page, everything is working as expected again.
I am testing with an iPhone 6 and Chrome.
Did someone already encountered an issue like that?
I have absolutely no idea how to track down this behaviour and all suggestions are welcomed, What do you suggest I should look in priority?
This issue was coming from a bug in a version of Chrome I was using at that moment (I have no idea which one, since my phone has regular automatic updates).
I strongly advise to have always at lease two different platforms when testing websites!

Horizontal Scroll on iOS — Off Canvas Navigation Menu

After pushing my site to the development server, I'm seeing horizontal scrolling on iOS (which I wasn't seeing when developing locally). I'm using an off canvas navigation menu which is giving the page the extra width. Here is the site.
Any help is greatly appreciated. Thanks for your time!
I inspected your site in Desktop Safari and I see the same issue.
The issue seems to be that the site layout still thinks it's wider. At first I was certain that a simple application of overflow-x:hidden and width:100% would do the trick.
However—
You seem to have done that.
It didn't.
I found it difficult to sift through the CSS because you have a lot going on, and I think it's possible that the CSS3 transforms are contributing to the issue, but I was able to lock it down while viewing in Desktop Safari and while inspecting Mobile Safari directly with the following:
Apply position:fixed to your primary navigation, rather than position:absolute. Desktop Safari was happy with this.
Remove your .site-content::before pseudo-element. This was still causing the issue on Mobile Safari. Removing the CSS transform to translate3d(100%,0,0) also helped.
Side note: You might also consider ways to simplify your HTML and/or CSS. You have 1.1MB loading without any real images; for mobile users, bandwidth is a real cost. I know that can be a PITA but worth mentioning. Good luck!

<img> not appearing on iPad.

I'm experimenting with different techniques using Amazium here http://stevengeorgeharris.com/croft/croft; when viewing on an iPad the image of the ballet dancer is missing, yet appears on everything else including Nexus 7 and iPhone 5. I have played around with positioning and z-index's but nothing happens.
I then went into IOS simulator to use web inspector and I noticed when I refresh the page the image appears and quickly disappears again. I cannot for the life of me find the cause of the problem, maybe I am over looking something very simple, as I usually do.
Change position:relative to position:absolute for it to show up on iOS.
i just see the website try to add overflow:hidden it will be good in regular explorer but it will not work in iOS but look nice

iOS 4.2.1 Mobile Safari won't show poster image

I've been working on an iPad-specific site that uses HTML5 video and though I've got video playback working, I can't for the life of me get the poster image to appear. It looks fine on Desktop Safari. Here's the code:
<video src="video/about_the_man.mp4" controls height=360 width=480 poster="video/posters/about_the_man.jpg"></video>
I've using this link as a reference (listing 1.2): https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/AudioandVideoTagBasics/AudioandVideoTagBasics.html#//apple_ref/doc/uid/TP40009523-CH2-SW6
It says that on iOS the poster image will be shown until the user initiates playback, but right now all I'm getting is a black video-sized screen with a big play button in the center. I've looked at other postings on this top (here and here) but neither solution has worked for me. The only thing that's a little bit unconventional about the site is that the video element is in an inline lightbox, so initially on pageload it's not visible, but I don't know why that would make a difference.
I had the exact same problem. I decided to try my code on other iPad's, and it worked fine. The poster image showed up.
After scratching my head for a bit, the solution was to hard reset the iPad and try again. After a reboot, my iPad displayed the poster image as it should.
Maybe it will work for you?
I found there is a limit to the amount of images you can load on an iPad
Here is what it says:
I hit a mobile Safari limitation recently when building an AJAX-y site
on the iPad. If you load a ton of images eventually mobile Safari cuts
you off and will display a [?] instead of the image. After doing some
tests it appears that this limit is around 6.5 MB. Here’s a test page
I made that attempts to load 20 500kb images. When opening this page
on an iPad, 7 of the images don’t appear, even though in Charles they
are returning 200 – success. I’m assuming this is similar to the way
autoplay is disabled for the video tag on iPad/iPhone. Apple probably
wants to make sure users don’t get overloaded with downloads when
browsing on 3G.
Anyhow, 6.5 MB is a hefty load and wouldn’t fare well on 3G, but for one reason or another you may want to work around this limitation. I found the easiest way to patch my code was to load the image into a canvas tag using drawImage(). The canvas tag appears to be immune to the limitation.
Here’s another test page using the canvas tag, all the images should load.

Resources