HOW to make a full page color less (black/white) usin JavaScript - See example too

Discussion in 'JavaScript' started by KingCobra, Feb 19, 2011.

  1. #1
    Have there any javascript or any way to make a full page or site colorless (black/white)?

    Please see the attached image.

    Actually I want to make my site colorless for one day only.

    Also please tell me is it possible to make everything colorless except one image.

    PLEASE HELP ME. color.jpg
     
    KingCobra, Feb 19, 2011 IP
  2. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Unfortunately it isn't possible. The only way is to do this is manually. Server-side scripting could help in doing this, but manual work would still be required.
     
    camjohnson95, Feb 21, 2011 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    After some searching, I found this method to make a greyscale webpage. Easy enough to do with IE but other browsers are a pain. This demo only works in IE.
    
    <html>
    <head>
    <style type="text/css">
    body {
     filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
     zoom: 1; /* hasLayout */
    }
    h1 { color: red; }
    p { color: blue; }
    </style>
    </head>
    <body>
    <h1>Heading</h1>
    <p>This is a line of text</p>
    <img src="image.jpg">
    </body>
    </head>
    
    Code (markup):
    There are other methods (SVG filter, canvas) but I had trouble getting them to work.
     
    Cash Nebula, Feb 22, 2011 IP
  4. srisen2

    srisen2 Peon

    Messages:
    359
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    cool, for once IE does something better than the other browsers
     
    srisen2, Feb 22, 2011 IP