Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
Mouseup example jquery in Jquery functions of JQuery Examples
1722 Views
Hints 
When you press the mouse button(i.e the button moving down) the mousedown() called.And when you release the mouse button(i.e the button moving up) the mouseup() function called.

In the following example When you press the element one div will appear, when you release the button the div will hide.
Example Code
<html>

<head>
    <title>HTML-JQuery</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $(".one").mousedown(function () {
                $(".two").show();
            });
            $(".one").mouseup(function () {
                $(".two").hide();
            });
        });
    </script>
    <style type="text/css">
        .two {
            display: none;
        }
    </style>
</head>

<body>
    <div class="one">click this element</div>
    <div class="two">you pressing the element</div>
</body>

</html>
Example demo 
Next Topics
Next lessons of current book.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details