CSS is a general solution for transparent effects and javascript or jquery is used to change transparency.

Source: Internet
Author: User
There are many solutions to implement transparency using CSS. Here we only introduce general methods:. transparent_class {filter: alpha (opacity = 50); // standard css transparency, in most

There are many solutions to implement transparency using CSS. Here is just a general method:

. Transparent_class {filter: alpha (opacity = 50); // standard css transparency, effective opacity: 0.5 in most standard browsers Firefox, Safari, and Opera; // compatible with IE solution-moz-opacity: 0.5; // old Mozilla browsers such as Netscape Navigator. almost no-khtml-opacity: 0.5; // compatible with the old Safari (1.x) version, rarely used}

Yes How CSS changes transparency, Then use It's easy to dynamically change the transparency of javascript.:
                    
         Script window. onload = function () {var myDiv = document. getElementById ("transparent_div"); myDiv. onclick = function () {myDiv. style. opacity = ". 4 "; // for all general browsers myDiv. style. filter = "alpha (opacity = 40)"; // for IE browser} script    This is transparent div

JQuery implements the following changes to transparency:
$("#transparent_div").css({ opacity: .4 });

JQuery also allows you to easily achieve the animation effect:
$ ("# Transparent_div "). click (function () {$ ("# transparent_div "). animate ({opacity :. 4}, 1000, function () {alert ("animation completed ");});});
Related Article

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.