ソースを参照

上拉回弹test3

jmx 8 年 前
コミット
985b7feb95
2 ファイル変更5 行追加10 行削除
  1. 4 0
      www/webapp/framework/iscroll5/iscroll.js
  2. 1 10
      www/webapp/o2o/js/page/home.js

+ 4 - 0
www/webapp/framework/iscroll5/iscroll.js

@@ -492,6 +492,10 @@ IScroll.prototype = {
 		newX = this.x + deltaX;
 		newY = this.y + deltaY;
 
+		if (newY < this.maxScrollY && this.pointY < 1){
+			this.scrollTo(0, this.maxScrollY, 400);
+		}
+		
 		// Slow down if outside of the boundaries
 		if ( newX > 0 || newX < this.maxScrollX ) {
 			newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;

+ 1 - 10
www/webapp/o2o/js/page/home.js

@@ -247,17 +247,8 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
                     setTimeout(function () {
                         pageData.scroll = new IScroll('#homeScroll', {
                             preventDefaultException: {className: /(^|\s)home-content(\s|$)/},
-                            onScrollMove: function () {
-                                console.log(this.y);
-                                console.log(this.maxScrollY);
-                                console.log(this.pointY);
-                                if (this.y<this.maxScrollY && this.pointY < 1){
-                                    console.log('???????????????????????');
-                                    this.scrollTo(0, this.maxScrollY, 400);
-                                }
-                            }
                         });
-                    }, 50);
+                    }, 200);
                 });
             }