Transition events

It can be useful to know when transitions are beginning and ending. Svelte dispatches events that you can listen to like any other DOM event:

  1. <p
  2. transition:fly="{{ y: 200, duration: 2000 }}"
  3. on:introstart="{() => status = 'intro started'}"
  4. on:outrostart="{() => status = 'outro started'}"
  5. on:introend="{() => status = 'intro ended'}"
  6. on:outroend="{() => status = 'outro ended'}"
  7. >
  8. Flies in and out
  9. </p>