_php Tutorials for Firefox,chrome-compatible Web page grayscale effects

Source: Internet
Author: User
Just technically, to achieve grayscale, the most secure way is to directly handle all images, regardless of compatibility, regardless of efficiency. However, the workload is relatively large, switching back also laborious.

IE Series support CSS filter, a sentence filter:gray; It solves all the problems. But, as we all know, IE is famous for its inefficiency, you will find that the speed of the opening is significantly reduced. 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 simulation of 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, I can tell you how to use it directly.

1. Download the Grayscale.js file

2. Refer to this JS file in your header



3. To achieve the full-station grayscale, call in the OnLoad event

Grayscale (document.body);

My theme background pictures more, processing more difficult, there may be some pictures disappear ...

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

http://www.bkjia.com/PHPjc/324198.html www.bkjia.com true http://www.bkjia.com/PHPjc/324198.html techarticle just technically, to achieve grayscale, the most secure way is to directly handle all images, regardless of compatibility, regardless of efficiency. However, the workload is relatively large, switching ...

  • 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.