Monday, October 7, 2024
Google search engine
HomeLanguagesJavascriptscript.aculo.us DropOut Effect

script.aculo.us DropOut Effect

The Effect.DropOut() method of script.aculo.us is used for removing and showing element from the DOM simulating a drop down effect. The core effects, Effect.MoveBy() and effect.Opacity() are combined to make the DroupOut effect. It can be implemented along with Effect.Appear() to drop the element and then show it again.

Syntax:

new Effect.DropOut(element_id, {options});

This effect does not require any specific parameters. The common parameters of visual effect module can be used.

Example:




<!DOCTYPE html>
<html>
  
<head>
  
    <script type="text/javascript" 
        src="prototype.js">
    </script>
  
    <script type="text/javascript" 
        src="scriptaculous.js">
    </script>
  
    <script type="text/javascript">
        function ShowElement(element) {
            new Effect.Appear(element, { duration: 1 });
        }
  
        function HideElement(element) {
            new Effect.DropOut(element, { duration: 3 });
        }
  
    </script>
</head>
  
<body>
    <div onclick="ShowElement('element')">
        <Button>Show Content</Button>
    </div>
    <br />
  
    <div onclick="HideElement('element')">
        <Button>Hide Content</Button>
    </div>
    <br />
    <img id="element" src="GEEKSIMAGES/gfg.png">
</body>
  
</html>


Output:

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments