2010-10-08 compatible with +jquery3 in the browser

Source: Internet
Author: User
Tags set time

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

    1. Child elements are also transparent: opacity:0.5
    2. 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

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.