使用不透明度作为淡入淡出效果

时间:2017-10-26 16:57:30

标签: javascript jquery html tween

如何使用不透明度使画架具有淡化效果?缓动工作得很好,但似乎对缓和效果不一样。

无论如何要修复这个或一些可行的替代方案?顺便说一句,只是启动并使用旧代码进行试错。

非常需要帮助,所以我可以继续尝试不同的。

        function updateBoard() {
            play();
            if ($('#mTextLT21').html() != mTextLT21) {
                animating = true;
                $('#mTextLT21').tween({
                    fadeTo: {
                      start: 0,
                      time: 1,
                      stop: 100,
                      duration: 0.5,
                      effect: 'easeIn'
                    },
                    onStop: function(){
                        $('#mTextLT21').html(mTextLT21);
                    }
                });

                $('#mTextLT21').tween({
                    opacity: {
                      start: 100,
                      time: 3,
                      stop: 0,
                      duration: 0.5,
                      effect: 'easeOut'
                    },
                    onStop: function(){
                        animating = false;
                    }
                });
            }


            if ($('#mTextLT22').html() != mTextLT22) {
                animating = true;
                $('#mTextLT22').tween({
                    opacity: {
                      start: 50,
                      stop: 100,
                      time: 1,
                      duration: 0.5,
                      effect: 'easeIn'
                    },
                    onStop: function(){
                        $('#mTextLT22').html(mTextLT22);
                    }
                });

                $('#mTextLT22').tween({
                    opacity: {
                      start: 100,
                      time: 3,
                      stop: 0,
                      duration: 0.5,
                      effect: 'easeOut'
                    },
                    onStop: function(){
                        animating = false;
                    }
                });
            }

            $.play();
            doUpdate = false;
        }

0 个答案:

没有答案