废话不多说了,先给大家展示下效果图:
这是iOS下的效果,android下完全一致。通过do_GestureView组件和do_Animation组件,deviceone能很容易实现复杂的跨平台纯原生动画效果,这个示例就是通过手势控制图片上下动画滑动实现开合效果,还支持声音效果。
下面是主要的代码
=json_define.length) currentIndex=0;
nextView=json_define[currentIndex].view;
for(var i=0;iottom","NextPagemove");
});
do_Page.on("NextPagemove",function(){
nextView.fire("initMoving","NextPagemoved");
});
do_Page.on("NextPagemoved",function(){
currentView.y= 0;
nextView.y= 1332;
do_ALayout_main.y=0;
do_ALayout_main.redraw();
do_ALayout_main.animate(do_Animator1,function(){
nextView.fire("opening");
});
});
do_Page.on("PrePagemoveing",function(){
currentView=json_define[currentIndex].view;
currentIndex--;
if (currentIndex<0) currentIndex=json_define.length -1;
nextView=json_define[currentIndex].view;
currentView.fire("closingHead","PrePagemove");
});
do_Page.on("PrePagemove","PrePagemoved");
});
do_Page.on("PrePagemoved",function(){
for(var i=0;iopening");
});
});
原文地址:https://www.jb51.cc/js/49123.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。