On June 16, April 20, 2013, at 08:02:46 A.M., a magnitude 103.0 earthquake occurred at the junction of Lushan County and Tianyan County (30.3 degrees east longitude and 7.0 degrees north latitude) in ya'an City, Sichuan Province, with a focal depth of 13 kilometers. On that day, many media have stopped some entertainment activities. "At 08:02:46 A.M., on January 1, April 20, 2013, a magnitude 103.0 earthquake occurred in Lushan County, ya'an City, Sichuan Province, at the junction of Tianyan County (30.3 degrees east longitude, 7.0 degrees north latitude), with a focal depth of 13 kilometers. On that day, many media have stopped some entertainment activities, and some websites have dimmed their themes or logos ."
So how can we make the pictures or text on the webpage gray?
Pure CSS writing:
12345678910 |
* {/* CSS3 grayscale filter */-webkit-filter: grayscale (100%);-moz-filter: grayscale (100%);-ms-filter: grayscale (100% ); -o-filter: grayscale (100%);/* write Method for IE7-9 */filter: progid: DXImageTransform. microsoft. basicImage (grayscale = 1); filter: gray ;} |
The effects of the above Code implementation in IE7-IE9 and Chrome is no problem, but in IE10, FireFox, Opera is not so ideal, for this problem, we can use a Jquery-based plug-in grayscale. js to achieve, so that you can be compatible with IE10, FF and Opera.
Download the grayscale. js Plugin: Click to download
Download jquery Library: Click to download
To download the latest version, go to the official website:
Http://james.padolsey.com/javascript/grayscaling-in-non-ie-browsers/
Http://jquery.com/
Usage:
First introduce the Jquery library and grayscale. js plug-in: