How to use jquery to set the transparency of a background:
Use CSS to set the transparency of the background, you can see how CSS Sets the div background transparency and compatibility , but using CSS to set the transparency does not have a dynamic effect, if the implementation is more difficult, the following describes how to use jquery to achieve the background transparency effect.
The code example is as follows:
<!DOCTYPE html><Html><Head><MetaCharSet= "Utf-8"><MetaName= "Author"Content= "http://www.softwhy.com/"/><Title> Ant Tribe</Title><StyleType= "Text/css">Div{Width:150px;Height:150px;Background-color:Green;}</Style><ScriptType= "Text/javascript"Src= "Mytest/jquery/jquery-1.8.3.js"></Script><ScriptType= "Text/javascript">$ (document). Ready (function(){ $("Div"). Animate ({"Opacity":"0.1 "},1500); }) </script>< Span style= "color: #0000ff;" ></head><< Span style= "color: #800000;" >body> <div< Span style= "color: #0000ff;" >></div> </body></< Span style= "color: #800000;" >html>
The above code can gradually change the transparency of the div within a specified time.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=5792
For more information, refer to: http://www.softwhy.com/jquery/
How to use jquery to set the transparency of a background