jquery implementation of the mouse over the div layer background color change method _jquery

Source: Internet
Author: User

This article illustrates how jquery realizes the color of the mouse over the div layer background. Share to everyone for your reference. The implementation methods are as follows:

Copy Code code as follows:
<title>jquery implementation of the induction mouse through the div layer transform layer background color) </title>
<style type= "Text/css" >
. divbox{
height:300px;
width:200px;
Background: #ffffff;
Border:solid 1px #ccc;
Float:left;
margin-right:10px;
}
. divover{
Background: #eff8fe;
Border:solid 1px #d2dce3;
}
#zztj {color: #ffffff;}
#zztj A, #zztj a:link, #zztj a:visited, #zztj a:active {color: #ffffff;}
#zztj a:hover {color: #ffffff;}
</style>
<script src= "/images/jquery.js" ></script>
<script language= "JavaScript" >
$ (function () {
Change the div's class to divover when the mouse is sliding
$ ('. Divbox '). Hover (function () {
$ (this). addclass (' Divover ');
},function () {
Remove Divover style when mouse leaves
$ (this). Removeclass (' Divover ');
}
);
});
</script>
<body>
<div id= "Menu" >
<div class= "Divbox" > Block a</div>
<div class= "Divbox" > Block b</div>
<div class= "Divbox" > Block c</div>
</div><br> tip: If you do not show the preview effect, please <font color=red> refresh the page </font&gt, because the remote jquery plug-in call, need to load completed to run.
</body>

I hope this article will help you with your jquery programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.