【问题标题】:Viewing a website using window.open in HTML5 jQuery Mobile within an iOS app在 iOS 应用程序中使用 HTML5 jQuery Mobile 中的 window.open 查看网站
【发布时间】:2015-01-30 22:51:33
【问题描述】:

我正在尝试在应用程序本身的 HTML5 jQuery iOS 移动应用程序中打开一个网页。

我正在使用:

 <a href="#" onclick="window.open('http://www.example.com', '_self', 'location=yes');">My Link</a>

但是,很明显,网站在应用程序上完全打开,无法关闭并返回应用程序。

无论如何我可以强制打开的网络链接的大小(比现在小)并添加一个“后退”链接吗?或者任何人都可以提出另一种(更好的)方法来做到这一点?我看得很清楚,但似乎找不到我要找的东西。

提前致谢!

【问题讨论】:

    标签: ios html jquery-mobile uiwebview window.open


    【解决方案1】:

    我实际上通过使用带有外部 div 的 iFrame 解决了我的问题

    -webkit-overflow-scrolling: touch 
    

    应用于其 CSS 以在 iOS 中滚动。

    <div style="position: absolute; top: 0; left: 0;z-index: 9999;overflow-y:auto;-webkit-overflow-scrolling:touch;width:1024px;height:600px">
        <iframe style="width:1024px;height:600px" src="http://www.bbc.co.uk"></iframe>
    </div>
    

    虽然这适用于我的方案,但它可能不是您的最佳选择。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-23
      • 2020-01-01
      • 2011-03-30
      • 2013-03-22
      • 1970-01-01
      • 1970-01-01
      • 2012-08-06
      相关资源
      最近更新 更多