Search results


29 Nov 2022 / 1 minute to read

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

Animating a HTML Element

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

Copied to clipboard
var animation = new ej.base.Animation({ duration: 5000 });
animation.animate('#element1', { name: 'FadeOut' });
animation.animate('#element2', { name: 'ZoomOut' });
Copied to clipboard
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
    <link href="" rel="stylesheet">
<script src="" type="text/javascript"></script>

    <div id="container">
        <div id="element1"></div>
        <div id="element2"></div>

var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>