Skip to content

Commit d2b7f7c

Browse files
committed
Merge pull request #6 from zhangxinxu/develop
Develop - use 'display:none' fix horizontal scroll bar bug!
2 parents 8d6dc3b + 700c0dc commit d2b7f7c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{
22
"name": "mobilebone",
3-
<<<<<<< HEAD
4-
"version": "1.1.0",
3+
"version": "1.1.1",
54
"description": "Bone main for mobile web APP with a sigle page mode.",
6-
=======
7-
"version": "1.0.0",
8-
"description": "Bone for mobile web APP with a sigle page mode.",
9-
>>>>>>> origin/develop
105
"main": "src/mobilebone.js",
116
"directories": {
127
"test": "test"

src/mobilebone.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a, img {
1111
body {
1212
margin: 0;
1313
-webkit-user-select: none;
14-
user-select: none;
14+
user-select: none;
1515
-ms-touch-action: none;
1616
}
1717

@@ -26,6 +26,7 @@ html, body, .page {
2626
animation: .35s ease-in-out;
2727
}
2828
.page.out {
29+
display: none;
2930
-webkit-transform: translateX(-100%);
3031
transform: translateX(-100%);
3132
}
@@ -34,7 +35,6 @@ html, body, .page {
3435
transform: translateX(0);
3536
}
3637

37-
3838
/* mask layer when ajax sending... */
3939
.mask {
4040
height: 100%; width: 100%;

src/mobilebone.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @type string
4040
**/
41-
Mobilebone.VERSION = '1.1.0';
41+
Mobilebone.VERSION = '1.1.1';
4242

4343
/**
4444
* Whether bind events when dom ready
@@ -185,6 +185,8 @@
185185
}
186186

187187
// do transition
188+
pageInto.style.display = "block";
189+
pageInto.clientWidth;
188190
pageInto.classList.remove("out");
189191
pageInto.classList.add("in");
190192
pageOut && pageInto.classList.add(params_in.form);
@@ -209,6 +211,12 @@
209211
});
210212
if (!store[pageid]) {
211213
var animateEventName = isWebkit? webkitkey: animationkey;
214+
index && pageInto.addEventListener(animateEventName, function() {
215+
if (this.classList.contains("in") == false) {
216+
this.style.display = "none";
217+
}
218+
});
219+
212220
if (typeof animition == "string" && params_in.root[animition]) {
213221
pageInto.addEventListener(animateEventName, function() {
214222
params_in.root[animition](this, this.classList.contains("in")? "into": "out");

0 commit comments

Comments
 (0)