Implementation Method for changing the browser gray

Source: Internet
Author: User

Implementation Method for changing the browser Gray:
1. The simplest and most direct way is to gray the image. (Suitable for modifying a small number of images and compatible browsers)
2. Use filters (ie filter and css3 filter) for control, such as (being able to modify all elements (including images), compatible with IE series and WebKit series)

-WebKit-filter: grayscale (100%);-o-filter: grayscale (100%);-MS-filter: grayscale (100%); filter: grayscale (100%); filter: progid: DXImageTransform. microsoft. basicimage (grayscale = 1 );

3. Use the grayscale plug-in (Official Website: http://james.padolsey.com/javascript/grayscaling-in-non-ie-browsers ),
It is mainly used to convert the gray image through canvas, and use data: image/PNG; base64 to re-copy SRC.
(Compatible with most browsers, including Firefox. However, we recommend that you only have firefox call the grayscale plug-in to modify the specified image .)
Grayscale. JS:Http://james.padolsey.com/demos/grayscale/grayscale.js

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.