Firefox,chrome-compatible Web page grayscale effects _php Tips

Source: Internet
Author: User
Only technically, to achieve the Web page grayscale, the safest way to deal with all the images directly, regardless of compatibility, regardless of efficiency. However, the workload is larger, switching back also laborious.

IE Series support CSS filter, a sentence filter:gray; solves all the problems. However, as we all know, IE is famous for its inefficiency, you will find that the speed is significantly lower after opening. And, most deadly, is not valid under other browsers.

Is there a way to be compatible with all browsers? Yes. JavaScript can do, someone has already used JS to simulate IE's gray filter, if you are interested and willing to read English, you can go to see "grayscaling" in Non-ie BROWSERS. If you don't want to see it, I can tell you how to use it directly.

1. Download Grayscale.js file

2. Refer to this JS file in your header

<script type= "Text/javascript" src= ". /include/jscript/grayscale.js "></script>

3. To achieve total station Gray, in the OnLoad event to call

Grayscale (document.body);

My theme background pictures More, more difficult to deal with, may appear some pictures disappear ...

I will turn this effect on for three days, if the problem caused by the issue of the theme is not normal affect the browsing effect of the people please forgive me. Anyway come here are acquaintances, to affect also you several ...

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.