SoFunction
Updated on 2025-02-28

Example of usage of fadein and fadeout methods in jQuery

This article describes the usage of fadein and fadeout methods in jQuery. Share it for your reference, as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:///TR/xhtml1/DTD/">
<html xmlns="http:///1999/xhtml">
<head>
  <title></title>
  <style type="text/css">
    *{font-size:12px;}
    div{width:600px;margin:auto;}
    #control{background-color:gold;padding:10px;margin-bottom:10px;}
  </style>
  <script src="../js/jquery-1.5." type="text/javascript"></script>
  <script type="text/javascript">
    $(function () {
      $("#btnfadeIn").click(function () {
        $("#message").fadeIn(1000);
      });
      $("#btnfadeOut").click(function () {
        $("#message").fadeOut(1000);
      });
    });
  </script>
</head>
<body>
  <div >
    <input  type="button" value="Fake in div" />
    <input  type="button" value="Fare out div" />
  </div>
  <div >
    mouseover、mouseenterThe difference:divInsidediv。See Notes。It has something to do with the bubbling of events。<br /> 
    Regardless of whether the mouse pointer passes through the selected element or its child element,It will trigger mouseover event <br />
    Only when the mouse pointer passes through the selected element,It will trigger mouseenter event(Passing through a child element will not trigger)
  </div>
</body>
</html>

For more information about jQuery, please visit the special topic of this site:Summary of jQuery operation DOM node method》、《Summary of jQuery page element operation skills》、《Summary of common jQuery events usage and techniques》、《Summary of commonly used plug-ins and usages of jQuery》、《Summary of jQuery extension skills》、《Summary of jQuery table operation skills》、《Summary of common classic effects of jQuery"and"Summary of jquery selector usage

I hope this article will be helpful to everyone's jQuery programming.