UNPKG

mobilebone

Version:

Bone main for mobile web APP with a sigle page mode by using HTML5 history API router.

34 lines (31 loc) 1.49 kB
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <title>Mobilebone.js API文档-Mobilebone.pushStateEnabled</title> <link rel="stylesheet" href="../../src/mobilebone.css"> <link rel="stylesheet" href="../assets/docs.css"> </head> <body> <header id="header"></header> <aside id="aside"></aside> <div class="page out"> <div class="content"> <h2>Mobilebone.pushStateEnabled</h2> <p>是否启用历史记录。在实现一些单页应用时候,尤其针对PC端,此参数很有用。</p> <p>现在流行一种翻屏网页效果,例如QQ浏览器宣传页:<a href="http://browser.qq.com/" target="_blank">http://browser.qq.com</a>, mac qq浏览器宣传页:<a href="http://browser.qq.com/mac/">http://browser.qq.com/mac/</a>.</p> <p>Mobilebone非常适合驾驭这类web应用,此时,我们需要设置<code>Mobilebone.pushStateEnabled=false</code>, 因为每一屏就是个子页,而非独立页,无需历史记录。否则,用户点返回想退出该页,结果只是回到上一屏,会有问题的。</p> <h3>值类型</h3> <p>布尔值。设置为<code>true</code><code>false</code>.</p> </div> </div> <script src="../../src/mobilebone.js"></script> <script> Mobilebone.captureLink = false; window.navKey = "pushStateEnabled"; </script> <script src="nav.js"></script> <script src="../assets/docs.js"></script> </body> </html>