Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

触摸滑动 #1

Open
Wscats opened this issue Jul 30, 2016 · 1 comment
Open

触摸滑动 #1

Wscats opened this issue Jul 30, 2016 · 1 comment

Comments

@Wscats
Copy link
Owner

Wscats commented Jul 30, 2016

在对应控制器注入服务swipe

app.controller('autumnsCtrl', ['$scope', 'swipe', function($scope, swipe) {}])

在swipe对象上面执行method服务,并传入需要执行的回调函数
格式swipe.method([方向],[回调函数])
方向为四个top,bottom,left,right
回调函数的参数可以获取滑动前后的x和y坐标,并且方向的信息
具体是对象中的x1,x2,y1,y2属性,和direction属性
例如

swipe.method("bottom",function(e){
    console.log(e)
})
@Wscats
Copy link
Owner Author

Wscats commented Jul 30, 2016

control
存放控制器的文件

dist
存放框架等文件

gh-pages
存放示例文件

image
存放图片素材

view
存放视图文件

存放控制器的文件 存放框架等文件
control dist
存放示例文件 存放图片素材
gh-pages image
存放视图文件
view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant