官术网_书友最值得收藏!

Animating slides

The fullscreen display only has one slide at any time. A new slide will be initially placed on the top of the screen and will be gently lowered into view. The old slide will, from the presentation viewer's point of view, vanish instantly.

Animating slides

Using a timer

The periodic timer in Dart should be a familiar friend of yours by now. This is used to check whether the slide has reached the final position. If it is not there yet, then the position is updated:

    new Timer.periodic(new Duration(milliseconds: 50), (timer) {
      if (isFullScreen && liveSlideY < 0) {
        liveSlide.style.top = liveSlideY.toString() + "px";
        liveSlideY += 50;
      }
    });

You may be concerned that the Timer object runs all the time, even when a presentation is not running fullscreen. In reality, they are very lightweight and the work that the animation performs is so minimal that it will have a negligible impact.

主站蜘蛛池模板: 大同市| 芷江| 沿河| 阜平县| 太谷县| 平江县| 东至县| 溆浦县| 广平县| 莱阳市| 乡城县| 红桥区| 连云港市| 宜良县| 澳门| 交口县| 肥东县| 遂宁市| 嘉兴市| 安吉县| 鸡东县| 长海县| 绥宁县| 盐城市| 南汇区| 铜梁县| 邵阳市| 兴宁市| 芷江| 贡觉县| 南乐县| 桃江县| 宁城县| 吉木萨尔县| 宁城县| 昌宁县| 林甸县| 马龙县| 龙南县| 房产| 三亚市|