Answer the question
In order to leave comments, you need to log in
Is there a script to instantly turn a site into black and white?
Here you have a website. Colorful. And in order to show visitors what they lose if all the colors are removed from the site, we need a button that switches the entire page to black and white without reloading. Is it feasible at all? Provided dynamic images, fonts and backgrounds in css, and much more.
Answer the question
In order to leave comments, you need to log in
Filter in IE: msdn.microsoft.com/en-us/library/ms532972 (v=vs.85).aspx
Can be applied to the whole page with grayscale=1. It is clear that it does not fit as a universal solution, but IE5.5 was able to do it. :)
I don't see a simple solution. You need to go over the entire DOM tree and do something b/w.
Pictures can be turned into black and white using canvas, I don’t know other ways to do it on the fly.
Well, the rest of the elements - using CSS, or something like that, it should be easier here.
And somehow you need to remember the state of the elements in order to return everything back later.
In the long run, the following can help - when uploading new photos to the site, also save its black and white copy. And when requested by the user, issue a slightly modified css: for the text, write the rules right away, and for pictures, change, for example, background: url('images/back.png'); on background: url('images/back-gray.png'), where back-gray.png is the same black and white copy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question