Solution to failure of the opacity attribute in earlier versions of Internet Explorer

Source: Internet
Author: User

Previously, we thought that versions earlier than ie9 did not support the opacity attribute. Therefore, the unique filter masks of opacity and IE are used simultaneously. However, sometimes some dynamic effects are required, such as the gradual disappearance and hiding of layers. Dynamic Opacity is required. In this case, it is a little troublesome to use both opacity and filter.
In fact, only opacity + jquery can completely solve this problem.

The usage is as follows:

<script type="text/javascript">    $(function () { $("#p1").css("opacity", 0.6); });</script>

Because JavaScript code cannot be written in the blog, interested friends can directly copy the following sample code to the TXT file,
Change the file suffix to .html, and then run the file directly to view the effect in the browser.

<! Doctype HTML public "-// W3C // dtd xhtml 1.1 // en" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <HTML> 

 

Solution to failure of the opacity attribute in earlier versions of Internet Explorer

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.