(Translated by https://www.hiragana.jp/)
GitHub - zhangxinxu/mobilebone: Single Page Switching bone(include page manage, events manage) for mobile web APP, Hybrid APP, Phonegap, PPT, Single-Screen PC page...
Skip to content

Single Page Switching bone(include page manage, events manage) for mobile web APP, Hybrid APP, Phonegap, PPT, Single-Screen PC page...

License

Notifications You must be signed in to change notification settings

zhangxinxu/mobilebone

Repository files navigation

mobilebone.js

单页きり换骨。适用于移动Web APP, Hybrid混合こんごうAPP, 单页H5あるPC应用。かんかた网站:http://www.mobilebone.org/

设计理念りねん

mobileboneほん质上いち个纯UIおもて现层てきJS插件,如果ぼつゆうmobilebone.js,わが们的项目依然いぜん以运さくてきただ形式けいしきじょう传统てき页面とべ转。明白めいはくいちてん,就应该可以理解りかい为何请求页面ちゅうてきsrcてきscript执行りょう

这种无侵入しんにゅうてき设计理念りねん使とくmobileboneさらぞういち个外挂,一个精美的外衣,にちきさき欢了,直接ちょくせつ拿掉就可以,完全かんぜん不要ふよう担心ぜんはし变化ふとかい项目跟不じょう怎么办。どう时,保留ほりゅうりょう传统页面SEO友好ゆうこうとう优点。

教程きょうてい和文わぶん

狠狠地点ちてん击这さと

实例、测试和文わぶん

きん项目GIF录屏

实线じょう项目あんれい

Cはし视频制作せいさくhttps://activity.hongxiu.com/be-video/

也可以手つくえ扫描访问:

さいようVue + Mobilebone实现。

其他あんれい

为何需要じゅよう

类原せいAPPてき过场たい验,适用于这些场けい

  1. またがうつり动平だい开发,せい态页めんindex.html, 单页めんいん此,需要じゅよう跟原せい一样的过场体验。
  2. Hybrid app开发,原生げんせいAPPないはまweb APP, 为了两者たい一致いっちいたり于交互太唐突とうとつ,也需よう刷新さっしん过场效果こうか
  3. 就算纯粹てきうつり动web APP, 使用しよう刷新さっしんしき也不しつ为一种不错的选型策略。
  4. 对兼ようせいぼつゆう要求ようきゅうてき单页PC应用,如类PowerPoint webぶん档,单页こぼしへいweb站点とう

如何いか使用しよう

つつみ引入:

npm install mobilebone
<!-- 支持しじimport引入 -->
<script>
import Mobilebone from 'mobilebone'
// はつはじめ
Mobilebone.init();
</script>
<!-- れい如在Vueちゅう -->
<style src="mobilebone/dist/mobilebone.css">

支持しじ直接ちょくせつ链接しょう关的CSS以及JS, 如下:

<link rel="stylesheet" href="./src/mobilebone.css">
<script src="./src/mobilebone.js"></script>

HTML结构需要じゅようゆう一定いっていてき要求ようきゅう

body
  page
  page
  page

まい个page个满へい元素げんそ, 相当そうとう于一个独立どくりつてき页面。

Mobileboneかい动捕获页めんじょうてきa元素げんそ,如果其href值存在そんざいねこ腻,就会さわ发切换行为。れい如:

<a href="#targetPage">标页めん</a>

とうclick此元素げんそ时候,页面かい动无刷新さっしんきり换到idtargetPageてき页面。

也可以使用しようajax请求。れい如:

<a href="detail.php?id=112">请求详情页</a>

所有しょゆうajax请求だま认是缓存てき,如果你想すえurl缓存,以设おけdata-reloadあるものdata-reload="true";如果你想すえurl缓存,需要じゅよう设置data-reload="root"

你可以控せいきり换的方向ほうこう任意にんい扩展动画类型,以被seajs, requiejs块化载(require('mobilebone')),以和Backbone组合使用しようとう

当然とうぜん上面うわつらかい绍的,ただきょう大功たいこうのうてき冰山一角いっかくさらしんいき参考さんこう这里.

插件

  1. mobilebone.ppt.js: 以让web页面ひょう现如幻灯げんとうへんえんじしめせ尺寸しゃくすん适应。 demoてん击这さと

优势?

mobilebone.jsただ做了いちけん事情じじょうきり换。所以ゆえん,JSぶんけん很小,gzipきさき4~5K, 而且很灵かつ,几乎ぼつゆうにんなんUIてききりせい,适用于各个项かく个场けいどう时,巧妙こうみょう提供ていきょうかく类缓そん管理かんり事件じけん管理かんりてきせっこう,就像个完せい健全けんぜんてきほね体系たいけい,就等你来添肉りょう

许可

MIT许可

mobilebone.js

Single Page Switching bone for mobile web APP, Hybrid APP, Phonegap, ...

git clone git://github.com/zhangxinxu/mobilebone.git

use npm:

npm install mobilebone

Documents

Examples and Tests

  1. Example1: http://iancj.github.io/qq/
  2. Example2: http://baozoumanhua.com/mobile_makers/
  3. Example3: http://wap.neeqsz.com

Why need this?

Interaction experience is good enough to compare with the native APP.

  1. Phonegap that to native APP is a single index.html, We need the same switch effects as native.
  2. Hybrid app, as you know, mixed web-app and native-app. So, it' better that they have some switching experience.
  3. Even no refresh interaction is not something bad for mobile APP.

How to use?

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.

Plugins

  1. mobilebone.ppt.js: make web page to powerpoint presentation. demo here.

Advantage?

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.

License

The MIT License

About

Single Page Switching bone(include page manage, events manage) for mobile web APP, Hybrid APP, Phonegap, PPT, Single-Screen PC page...

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •