zoukankan      html  css  js  c++  java
  • 小程序 wepy wx.createAnimation 向右滑动渐入渐出

    <style lang="less">
    .animation {
    100vw;
    height: 100vh;
    opacity: 0;
    background-color: inherit !important;
    position: fixed;
    top: 0;
    left: 0;
    }
    .inner {
    100%;
    height: 100vh;
    background-color: #ffffff !important;
    }
    </style>
    <template>
    <view>
    <view class="animation" animation="{{animationData}}"></view>
    <view class="inner"></view>
    </view>
    </template>

    <script>
    import wepy from 'wepy'

    export default class Pass extends wepy.page {
    config = {
    navigationBarTitleText: 'test'
    }
    components = {}

    data = {
    animation: null,
    animationData: {}
    }

    methods = {}

    events = {}

    onReady() {
    this.width = this.$parent.globalData.winWidth
    this.height = this.$parent.globalData.winHeight
    this.animationData = null
    this.animation = null
    this.$apply(() => {
    this.slideRight(this, -this.width)
    })
    }

    slideRight(vm, px) {
    vm.animation = wx.createAnimation({
    duration: 5000,
    timingFunction: 'ease',
    delay: '0',
    success: function(res) {
    console.log('animation success: ', res)
    },
    fail: function(err) {
    console.log('err:', err)
    }
    })
    vm.animation.translateX(px + 'px').opacity(1).step()
    vm.animationData = vm.animation.export()
    }
    }
    </script>
  • 相关阅读:
    CodeForces 706C Hard problem
    CodeForces 706A Beru-taxi
    CodeForces 706B Interesting drink
    CodeForces 706E Working routine
    CodeForces 706D Vasiliy's Multiset
    CodeForces 703B Mishka and trip
    CodeForces 703C Chris and Road
    POJ 1835 宇航员
    HDU 4907 Task schedule
    HDU 4911 Inversion
  • 原文地址:https://www.cnblogs.com/zhaomeizi/p/9799516.html
Copyright © 2011-2022 走看看