Giter Site home page Giter Site logo

reveal.js-transit's Introduction

reveal.js-transit

This plugin is no longer needed, because Reveal 4 added the slidetransitionend event.

A plugin for Reveal.js 3 that checks if slides and fragments are done transitioning.

Sometimes you want effects, images, graphs etc to kick in only after a slide in Reveal.js has ended the slide transition. Reveal versions lower than 4 have no "slidetransitionend" event, so this plugin does just that.

It is likely that a future version of Reveal.js wil make this plugin obsolete :-)

Here's a demo of a project that also uses this transit.js plugin.

Transit.js does multiple things:

  • Emits an event "slidechangecomplete" after a slide has completed its transition. The event object keeps reference to the previous and current slide HTML nodes as event.currentSlide and event.previousSlide, just like the "slidechange" event.
  • Emits an event "fragmentshowncomplete" after a fragment has completed its "shown" transition. The fragment is available in the event object as event.fragment.
  • Emits an event "fragmenthiddencomplete" after a fragment has completed its "hidden" transition. The fragment is available in the event object as event.fragment.
  • Toggles a class "done" on slides and fragments depending on the transition state.

Installation

Copy the transit folder to the plugins folder of the reveal.js folder, like this: plugin/transit. Now add it to the dependencies of Reveal.js:

Reveal.initialize({
	// ...
	dependencies: [
		// ... 
		{ src: 'plugin/transit/transit.js' },
		// ... 
	]
});

Like it?

This is my third Github repo... let me know if you like it.

License

MIT licensed

Copyright (C) 2019 Martijn De Jongh (Martino)

reveal.js-transit's People

Contributors

kingofpayne avatar martinomagnifico avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kingofpayne

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.