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

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.

主站蜘蛛池模板: 海城市| 林州市| 犍为县| 淳化县| 云霄县| 特克斯县| 调兵山市| 年辖:市辖区| 平乐县| 侯马市| 莱州市| 清水县| 上杭县| 合江县| 昭通市| 连山| 玛纳斯县| 堆龙德庆县| 松滋市| 久治县| 罗城| 长乐市| 巫溪县| 仙游县| 衡水市| 东乌珠穆沁旗| 彭山县| 普定县| 翁源县| 罗田县| 康平县| 陇西县| 武穴市| 成安县| 天峨县| 兰溪市| 昌邑市| 饶阳县| 赣州市| 喀什市| 新宁县|