小程序动画教程

发布时间:2025-05-05 10:25

儿童绘画教程:动物画法教学示范 #生活乐趣# #生活艺术# #亲子生活艺术# #儿童绘画教程#

小程序菜单栏型弹出框

最新推荐文章于 2024-08-07 22:38:02 发布

陈大大的光荣光辉史 于 2018-06-22 11:31:17 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

        emmmmmmm,这是我的第一个发的博客。希望对大家有点帮助。

这是用的小程序自带的动画事件来是我们的弹出框显示和

var animation;

Page({

/**

* 页面的初始数据

*/

data: {

animationData: {}

},

tanchu:function(){

animation = wx.createAnimation({

duration: 1000,

timingFunction: 'ease',

})

this.animation = animation

animation.translate(0,-153).step();

this.setData({

animationData: animation.export()

})

},

hideModal:function(){

animation.translate(0, 0).step();

this.setData({

animationData: animation.export()

})

},

})

这部分是页面的,也没什么好说的了。

<button bindtap='tanchu'>点击</button>

<view class='kuai' animation="{{animationData}}">

<view class='les'>操作1</view>

<view class='les'>操作2</view>

<view class='les' bindtap='hideModal'>取消</view>

</view>

这是css其实没什么要写的。只要根据自己需求写样式,一开始先使用偏移将菜单栏移除试图区域。

.kuai{

width: 100%;

height: 300rpx;

background-color: #888888;

margin-bottom: -153px;

position: fixed;

bottom: 0;

}

.les{

color: white;

text-align: center;

height: 100rpx;

width: 100%;

line-height: 100rpx;

border-bottom:1rpx solid black;

}

样式丑是丑了点,毕竟只是练下手QAQ。


支持一下嘻嘻



网址:小程序动画教程 https://www.yuejiaxmz.com/news/view/927214

相关内容

悦运动小程序作品—微信小程序
教育小程序
教育学习小程序
在线教育小程序有什么优势?在线教育小程序源码
springboot毕设 码高教育课后在线小程序程序+论文
新手漫画技法教程
java 小程序自动发货 小程序自动化部署
手绘墙画教程
在线上课的小程序
DIY装修 · 微信小程序指导教程 · 看云

随便看看