Follow by Email

Monday, June 24, 2013

using jquery .hover method in asp.net | Jquery hover Example | Jquery hover method demo

hi in this post i will show how to use a jquery .hover method in asp.net.
Using Jquery hover method a event is triggered when a mouse points to an element. i.e. label, button etc.

Below is the example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<html>
<head>
    <title></title>
</head>
<body>
    <div>
        <p>this is Jquery</p>
    </div>

    <script language="javascript" type="text/javascript">
$("p").hover(
  function () {
      $(this).append($("<span> and it is Awesome</span>"));
  },
  function () {
      $(this).find("span:last").remove();
  }
);
    </script>
</body>
</html>

Result :
1.

2. on hover i.e when mouse points to the element