- Dart:Scalable Application Development
- Davy Mitchell Sergey Akopkokhyants Ivo Balbaert
- 152字
- 2021-07-09 18:56:20
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.

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.
推薦閱讀
- WildFly:New Features
- 程序員修煉之道:通向務(wù)實的最高境界(第2版)
- PHP編程基礎(chǔ)與實例教程
- Python全棧數(shù)據(jù)工程師養(yǎng)成攻略(視頻講解版)
- 愛上micro:bit
- 單片機原理及應(yīng)用技術(shù)
- Java Web開發(fā)實例大全(基礎(chǔ)卷) (軟件工程師開發(fā)大系)
- Practical GIS
- Apache Solr for Indexing Data
- HTML并不簡單:Web前端開發(fā)精進(jìn)秘籍
- Java面試一戰(zhàn)到底(基礎(chǔ)卷)
- jQuery Essentials
- SQL Server 2014數(shù)據(jù)庫設(shè)計與開發(fā)教程(微課版)
- Build Your Own PaaS with Docker
- Learning Google Apps Script