A Make background images full (compatible with various browsers)
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("Body"). Ezbgresize ({
IMG: "Image/bg.jpg",//Picture path
Opacity:1,
Center:true
});
});
</script>
Two Make Div Translucent
- Child elements are also transparent: opacity:0.5
- Child element opacity: Background:rgba (0,0, 0, 0.4);
Another: In order to make it appear in the lower version, that is, to achieve browser compatibility, can be written as:
Background:rgba (0,0, 0, 0.4)!important;
Filter:alpha (OPACITY=40);
jQuery (3)
Nine. set element style
1. Add and remove CSS categories
$ ("div"). addclass ("MyClass1 myclass2")//If the two styles have the same properties set, the following (MYCLASS2) attribute values prevail.
$ ("div"). Removeclass ("MyClass1")//Remove style
2. Style alternating execution
1.$ (function () {
$ ("#btn"). Click (Function ({
$ (this). Toggleclass ("D2"); Keep switching when you click
}););
});
Note: Toggleclass can only set a class that cannot set multiple
2. $ (". D1"). Toggle (1000)//Click to show and hide alternating execution, set time 1 seconds
3. $ (". D1"). Toggle (function () {//Click, alternating execution, only supports the jquery class library file with lower version
$ (". D1"). Hide (1000);
},function () {
$ (". D1"). Show (1000);
});
3. Direct GET, set style
MouseOver: After the mouse is moved up
Mouseout: After the mouse is removed
$ (". D1"). MouseOver (function() { $ (this). CSS ("Color", "red");}); $ (". Di"). Mouseout (function() { $ (this). Hide (+);});
It can also be a combination of two styles:
$ (". D1"). Hover (function() { $ (". D1"). Hide (+); // after the mouse is moved, hidden within one second },function() { $ (". Di"). Show (+); // after the mouse is removed, the display in one second })
2010-10-08 compatible with +jquery3 in the browser