Search results


The Animation library is used to perform animation effects on HTML elements by running sequence of frames.

Animate HTML Element

The animate method of Animation library can be used to animate the HTML elements. This method can also take additional AnimationModel. Refer the following code snippet to animate a multiple DOM element

import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Animation } from '@syncfusion/ej2-base';

class App extends React.Component<{}, {}> {
    public componentDidMount(): void {
      let animation: Animation = new Animation({ name: 'FadeIn', duration: 5000 });
      animation.animate(this.element1, { name: 'FadeOut' });
      animation.animate(this.element2, { name: 'ZoomOut' });

    render() {
        return (
            <div id="container">
             <div id="element1" ref={(ele) => { this.element1 = ele; }}></div>
             <div id="element2" ref={(ele) => { this.element2 = ele; }}></div>
ReactDom.render(<App />, document.getElementById('sample'));
<!DOCTYPE html>
<html lang="en">

    <title>Syncfusion React Button</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Essential JS 2 for React Components" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <link href="//" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>

        <div id='sample'>
            <div id='loader'>Loading....</div>