单页
mobilebone
这种无
狠狠
C
也可以手
其他
- 实例1-仿QQ
界面 :http://iancj.github.io/qq/ - 实例2-
暴走 漫画 制作 器 :http://baozoumanhua.com/mobile_makers/ - 实例3-
太 湖 金谷 :http://wap.neeqsz.com
- 测试页面:./test/index.html
类原
跨 移 动平台 开发,静 态页面 都 是 index.html, 单页面 ,因 此,需要 跟原生 一样的过场体验。- Hybrid app开发,
原生 APP内 嵌 web APP, 为了两者体 验一致 ,不 至 于交互太唐突 ,也需要 无刷新 过场效果 。 - 就算
是 纯粹的 移 动web APP,使用 无刷新 模 式 也不失 为一种不错的选型策略。 - 对兼
容 性 没 有 要求 的 单页PC应用,如类PowerPoint web文 档,单页翻 屏 web站点等 。
npm install mobilebone
<!-- 支持 import引入 -->
<script>
import Mobilebone from 'mobilebone'
// 初 始 化
Mobilebone.init();
</script>
<!-- 例 如在Vue中 -->
<style src="mobilebone/dist/mobilebone.css">
也
<link rel="stylesheet" href="./src/mobilebone.css">
<script src="./src/mobilebone.js"></script>
HTML结构
body page page page
Mobilebone
<a href="#targetPage">目 标页面 </a>
id
为targetPage
也可以
<a href="detail.php?id=112">请求详情页</a>
data-reload
data-reload="true"
;如果你想data-reload="root"
。
你可以控require('mobilebone')
),
- mobilebone.ppt.js:
可 以让web页面表 现如幻灯 片 演 示 ,尺寸 自 适应。 demo点 击这里 。
mobilebone.js
MIT许可
Single Page Switching bone for mobile web APP, Hybrid APP, Phonegap, ...
git clone git://github.com/zhangxinxu/mobilebone.git
use npm
:
npm install mobilebone
- Guide documents: docs/guide/
- API documents: docs/api/
- Example1: http://iancj.github.io/qq/
- Example2: http://baozoumanhua.com/mobile_makers/
- Example3: http://wap.neeqsz.com
- Test page: test/index.html
Interaction experience is good enough to compare with the native APP.
- Phonegap that to native APP is a single index.html, We need the same switch effects as native.
- Hybrid app, as you know, mixed web-app and native-app. So, it' better that they have some switching experience.
- Even no refresh interaction is not something bad for mobile APP.
Just include mobilebone.css and mobilebone.js, as follow:
<link rel="stylesheet" href="mobilebone.css">
<script src="mobilebone.js"></script>
And, you should use specific HTML structure.
body page page page
Then Mobilebone will catch your attribute of href of 'a' element, and do switch. For example:
<a href="#targetPage">target page</a>
The interface will switch to page whitch's value of id
is targetPage
when you tap this link.
Of course, you can control the direction of switching, or use a ajax get, or as a modular loaded by seajs, requirejs using require('mobilebone')
...
For more detail, you can visit here.
- mobilebone.ppt.js: make web page to powerpoint presentation. demo here.
what mobilebone.js do just one thing - switching. So, it's small, flexible, and no any UI restriction. In a word, it's fit for variety of designs and scenes.
The MIT License