Monday, November 18, 2024
Google search engine
HomeLanguagesJavascriptscript.aculo.us Drag & Drop reverteffect Option

script.aculo.us Drag & Drop reverteffect Option

This script.aculo.us Drag & Drop reverteffect Option is used returns to its defined position when the drag ends. It also specifies whether the reverteffect callback will be invoked when the drag operation stops.

Syntax:

new Draggable('element', {reverteffect: 'effectFunction'});

Values:

  • reverteffect: This option takes the reverteffect function.

Example:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <script type="text/javascript" 
        src="prototype.js">
    </script>
  
    <script type="text/javascript"
        src="scriptaculous.js">
    </script>
  
    <script type="text/javascript">
        window.onload = function () {
            var img = 'gfg';
            new Draggable('gfg', {
                revert: true,
                reverteffect: function () {
                    new Effect.MoveBy('gfg', 100, 100);
                }
            });
        }
    </script>
</head>
  
<body>
    <div>
        <h1 style="color: green">
            neveropen
        </h1>
  
        <p>
            A Computer Science 
            Portal for Geeks
        </p>
    </div>
  
    <strong>
        script.aculo.us Drag & 
        Drop reverteffect Option
    </strong>
  
    <p>Drag and leave the image</p>
  
    <img id="gfg" src="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