Cross Browser CSS Opacity and the JavaScript Fade / Fading Effect(跨瀏覽器的CSS透明和JavaScript淡入淡出效果)

來源:互聯網
上載者:User

用上了,覺得不錯,分享一下

核心代碼:

.opacity50 {    opacity:0.50; /* firefox, opera, safari, chrome */    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=50)"; /* IE 8 */    filter:alpha(opacity=50); /* IE 4, 5, 6 and 7 */    zoom:1 /* so the element "hasLayout"    /* or, to trigger "hasLayout" set a width or height */}

原文地址:http://www.itnewb.com/tutorial/Cross-Browser-CSS-Opacity-and-the-JavaScript-Fade-Fading-Effect

使用twitter bootstrap的同學,可以給縮圖組件加上這個效果了,感覺很不錯啊。

.thumbnail img {opacity: 0.50;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";filter: alpha(opacity=50);zoom: 1}.thumbnail img:hover {opacity: 1;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";filter: alpha(opacity=100);zoom: 1}
相關文章

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.