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

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.

主站蜘蛛池模板: 金门县| 扎鲁特旗| 福建省| 中江县| 贺州市| 临安市| 肥东县| 朝阳市| 九龙城区| 清河县| 西乡县| 肥西县| 麻栗坡县| 岳池县| 二连浩特市| 普陀区| 会泽县| 临邑县| 汾阳市| 来安县| 鄂托克旗| 新乡县| 麻栗坡县| 怀来县| 岢岚县| 溧阳市| 安阳县| 称多县| 上高县| 松滋市| 南岸区| 谢通门县| 密云县| 怀仁县| 和林格尔县| 香港| 河北区| 四子王旗| 台南县| 曲周县| 专栏|