You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/tutorial/10-transitions/06-transition-events/text.md

18 lines
456 B

---
title: 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:
```svelte
<p
transition:fly={{ y: 200, duration: 2000 }}
on:introstart={() => (status = 'intro started')}
on:outrostart={() => (status = 'outro started')}
on:introend={() => (status = 'intro ended')}
on:outroend={() => (status = 'outro ended')}
>
Flies in and out
</p>
```