HTML5 canvas (only using the drawImage function) is not showing up on mobile devices, but is on my laptop.
You can see here : mmhudson.com/index.html (reload once)
I get no errors or anything, but it doesn’t display in chrome on iOS or the default browser on android..
EDIT:
This problem only occurs when the following meta tag is included in the document:
<meta name="viewport" content="width=device-width, initial-scale=1"></meta>
Your
init()function is called byimgLoad(), but you’re loading images only when the window width is greater than or equal to 480px:When you omit the meta viewport tag, the browser assumes a page / window width of 980px, and so your code runs normally.
When you include a meta viewport tag with
width=device-width, the browser sets the page / window width to the width of the screen (e.g. 320px on iPhone), and soimgLoad()andinit()is never called.