diff --git a/.idea/dictionaries/chenhao.xml b/.idea/dictionaries/chenhao.xml
new file mode 100644
index 0000000..5f6ff59
--- /dev/null
+++ b/.idea/dictionaries/chenhao.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/fileColors.xml b/.idea/fileColors.xml
new file mode 100644
index 0000000..646829e
--- /dev/null
+++ b/.idea/fileColors.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReadMe.md b/ReadMe.md
index 37ba11e..f9fc804 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -1,147 +1,4 @@
-mobilebone.js
-=============
-单页切换骨架。适用于移动web APP, Hybrid混合APP, Phonegap开发, 无兼容要求单页PC应用等。官方网站:http://www.mobilebone.org
-
-实例、测试和文档
-------------------
-
- - 实例1-仿QQ界面:http://iancj.github.io/qq/
- - 实例2-暴走漫画制作器:http://baozoumanhua.com/mobile_makers/
-
-
-
-
-
-
-为何需要?
--------------
-类原生APP的过场体验,适用于这些场景:
-1. Phonegap等类似跨移动开发平台,其静态页面都是index.html, 单页面,因此,需要跟原生一样的过场体验。
-2. Hybrid app开发,原生APP内嵌web APP, 为了两者体验一致,不至于交互太唐突,也需要无刷新过场效果。
-3. 就算是纯粹的移动web APP, 使用无刷新模式也不失为一种不错的选型策略。
-4. 对兼容性没有要求的单页PC应用,如类PowerPoint web文档,单页翻屏web站点等。
-
-
-如何使用?
----------------
-引入相关的CSS以及JS, 如下:
-<link rel="stylesheet" href="mobilebone.css">
-<script src="mobilebone.js"></script>
-
-HTML结构需要有一定的要求:
-body
- page
- page
- page
-
-每个page是个满屏元素, 相当于一个独立的页面。
-
-Mobilebone会自动捕获页面上的a元素,如果其href值存在猫腻,就会触发切换行为。例如:
-<a href="#targetPage">目标页面</a>
-
-当click/tap此元素时候,页面会自动无刷新切换到id
为targetPage
的页面。
-
-也可以使用ajax请求。例如:
-<a href="detail.php?id=112">请求详情页</a>
-
-所有ajax请求默认是缓存的,如果你想根据url地址不缓存,可以设置data-reload
或者data-reload="true"
;如果你想根据url根地址不缓存,需要设置data-reload="root"
。
-
-你可以控制切换的方向,任意扩展动画类型,可以被seajs, requiejs模块化加载(require('mobilebone')
),可以和Backbone组合使用等。
-
-当然,上面介绍的,只是强大功能的冰山一角,更多信息请[参考这里](http://www.zhangxinxu.com/wordpress/?p=4381).
-
-插件
-----------------
-
- - 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
-
-Examples and Tests and Documents
-------------------
-
- - Example1: http://iancj.github.io/qq/
- - Example2: http://baozoumanhua.com/mobile_makers/
-
-
-
-
-
-
-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](http://www.zhangxinxu.com/wordpress/?p=4381).
-
-Plugins
-----------------
-
- - 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
-
-
-
-
+该项目是[mobilebone](https://github.com/zhangxinxu/mobilebone)的分支,因为项目需要进行了以下修改:
+ 1.支持URL传值,例如:`产品列表`
+ 2.a标签如果有`data-title`可修改新页面的title
\ No newline at end of file
diff --git a/src/mobilebone.js b/src/mobilebone.js
index 2972e9e..fd6e350 100644
--- a/src/mobilebone.js
+++ b/src/mobilebone.js
@@ -3,7 +3,7 @@
* by zhangxinxu(.com) 2014-09-26
* https://github.com/zhangxinxu/mobilebone
* bone of switch for mobile web app
-**/
+ **/
(function(root, factory) {
if (document.MBLOADED) { return; }
@@ -12,7 +12,7 @@
define('mobilebone', function(exports) {
return factory(root, exports);
});
- // Finally, as a browser global.
+ // Finally, as a browser global.
} else {
root.Mobilebone = factory(root, {});
}
@@ -20,14 +20,14 @@
if (document.MBLOADED) {
return 'Don\'t repeat load Mobilebone!';
}
-
+
// Avoid repeated callbacks
var store = {};
-
+
// Create local references to array methods we'll want to use later.
var array = [];
var slice = array.slice;
-
+
// Is it a id selector
var isSimple = /^#?\w+(?:[\-_]\w+)*$/i;
@@ -36,11 +36,11 @@
// Is it suppory history API
var supportHistory = "pushState" in history && "replaceState" in history;
-
+
Mobilebone.support = supportHistory;
-
+
var hasInited = false;
-
+
/**
* Current version of the library. Keep in sync with `package.json`.
*
@@ -51,113 +51,113 @@
/**
* Whether catch attribute of href from element with tag 'a'
* If the value set to false, jump links in a refresh form(not slide)
- * In most cases, you do not need to care about this parameter.
- Except some special pages that should refresh all links, as test/index.html show.
- However, if your only want several links refesh, you can use data-ajax="false" or data-rel="external"
+ * In most cases, you do not need to care about this parameter.
+ Except some special pages that should refresh all links, as test/index.html show.
+ However, if your only want several links refesh, you can use data-ajax="false" or data-rel="external"
*
* @type boolean
- **/
+ **/
Mobilebone.captureLink = true;
-
+
/**
* Whether catch events of 'submit' from