Because MouseOver and mouseout often write together, so appeared the hover ()
Hover (function () {},function () {}); The first argument is the mouse-over function that runs, the second is the function that the mouse leaves running
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "Text/html;charset=utf-8" >
<title>Document</title>
<style type= "Text/css" >
#demo {width:200px; height:300px;background-color:green;}
</style>
<script type= "Text/javascript" src= "Jquery.js" ></script>
<script type= "Text/javascript" >
$ (function () {
$ ("#demo"). MouseOver (function () {
$ (this). css ({"width": "400px", "height": "600px", "Background-color": "Yellow"});
// });
$ ("#demo"). Mouseout (function () {
$ (this). css ({"width": "200px", "height": "300px", "Background-color": "Green"});
// });
$ ("#demo"). Hover (function () {
$ (this). css ({"width": "400px", "height": "600px", "Background-color": "Yellow"});
}, function () {
$ (this). css ({"width": "200px", "height": "300px", "Background-color": "Green"});
});
});
</script>
<body>
<div id= "Demo" ></div>
</body>
jquery's Hover () method (note)