How to use Event One() Method in JQuery

In this article I am going to explain about event One() Method in Jquery
  • 1947

jQuery Event one() method

jquery event method use when we want to attach one or more event handler for an selected item. And specifies a function for execute when event occurs.

Syntax

Here event specifies event handler one or more then one data specifies a value that pass through function and function specifies a function that should be executed.

$(SelectElement).one(event,data,function)

Example

<html>

<head>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("h1").one("click", function () {

                $(this).animate({ fontSize: "-=8px" });

            });

        });

    </script>

</head>

<body>

    <h1>

        Hello</h1>

    <h3>

        click this text for see efect</h3>

</body>

</html>

Output

Before click button

one1.jpg

After click button

one2.jpg

You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.