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 ");});});