1 var_scrollindex=1;2 functionScrollpage () {3 var_contentele = $ ('. View-container '), _viewele = _contentele.find ('. View ');4 var_iconele = $ ('. Downiconarror '));5 var_view_port = $ ('. View-port '));6 var_touchevents = {7' Pageystart ': ',8' Pageyend ': ',9' Touchstart ':function(event) {Ten Event.preventdefault (); One var_touch = Event.touches[0],_this =_touchevents; A_this.pageystart =_touch.pagey; -_view_port[0].addeventlistener (' Touchmove ', _this.touchmove,true); -_view_port[0].addeventlistener (' Touchend ', _this.touchend,true); the }, -' Touchmove ':function(event) { - Event.preventdefault (); - var_touch = Event.touches[0],_this =_touchevents; +_this.pageyend =_touch.pagey; - }, +' Touchend ':function(event) { A var_this =_touchevents; at var_distance = _this.pageyend-_this.pageystart; - if(_distance>50){ - Swipe.down (); - } - if(_distance<-50){ - swipe.up (); in } -_view_port[0].removeeventlistener (' Touchmove ', _this.touchmove); to_view_port[0].removeeventlistener (' Touchend ', _this.touchend); + } - }; the_view_port[0].addeventlistener (' Touchstart ', _touchevents.touchstart); * varSwipe = { $Upfunction(){Panax Notoginseng var_this =_contentele; - var_inittransy =GetTransform (_this); the if(Math.Abs (_inittransy) = = (_viewele.length-1) *_viewele.height ()) { + return; A } the if(Math.Abs (_inittransy) = = (_viewele.length-2) *_viewele.height ()) { + _iconele.hide (); -}Else{ $ _iconele.show (); $ } -_scrollindex++; - scrollpageanimate (_scrollindex); the_this.animate ({' Margin-top ':p arseint (_inittransy-_viewele.height ())},500); - },WuyiDownfunction(){ the var_this =_contentele; - var_inittransy =GetTransform (_this); Wu _iconele.show (); - if(_inittransy==0){ About return; $ } -_scrollindex--; - scrollpageanimate (_scrollindex); -_this.animate ({' Margin-top ':p arseint (_inittransy+_viewele.height ())},500); A } + } the}
Mobile Touch Backup