简体   繁体   中英

add2home.js on iOS6 does not close when user taps the x button

I am using this script to show mobile users how to add their website to the homescreen. It works as it should on an iPhone with iOS 5, but on iOS 6 the bubble does not fade out when the user clicks the [X] in the top right corner. It DOES fade out when the timeout has been reached (about 8-10 seconds).

The demo on the website has this problem, too.

JS and CSS source here .

I had the same problem. I found out it was to do with when my iphone 4s had private browsing switched to on. Apparently in private browsing mode safari throws a localStorage error.

There is a solution here. It worked for me: https://github.com/gdub22/add-to-homescreen/blob/845d5a5d3ceb0c7601a90b1fe31fc271670f9e58/src/add2home.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM