Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Interaction in jQuery with Drag-able

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 147
    Comment on it

    The Drag-able function can be used in JqueryUI to enable draggable functionality on a DOM element. Using Drag-able function we can drag the element by clicking on it with the mouse.

    Example code:

          <title>The jQuery Dragable Example</title>
          <script type = "text/javascript"
             src = ""></script>
          <script type = "text/javascript"
             src = ""></script>
          <script type = "text/javascript" language = "javascript">
             $(function() {
                $( "#draggable_element" ).draggable();
             #draggable_element { width: 150px; height: 150px; }
                background-color: yellow;
                width: 50px;
                padding: 25px;
          <div id = "draggable_element" class = "ui-widget-content">
             <p class = "back">Drag me</p>

    When you run this file in your browser you will see an element in yellow color with text Drag me, by clicking on this object with a mouse we can drag it anywhere within the viewport.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: