Saturday, November 15, 2025
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

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11917 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6890 POSTS0 COMMENTS
Ted Musemwa
7143 POSTS0 COMMENTS
Thapelo Manthata
6838 POSTS0 COMMENTS
Umr Jansen
6840 POSTS0 COMMENTS