1

How can i show image colored on mouseover?

My questions is similar to this jQuery script i follow for recursively changing images.

  • A grayscale image
  • A colored image

    $(document).ready(function () {
          $("#image").hover(function () {
              $(this).attr("src", "tpi/colored.jpg");
          }, function () {
              $(this).attr("src", "tpi/grayscale.jpg");
    
          });
      });
    

Now is there any other way in css or jQuery with that i could do this without using two images at a time on hover?

A. Wolff
  • 74,033
  • 9
  • 94
  • 155
Manoz
  • 6,507
  • 13
  • 68
  • 114

1 Answers1

2

Working DEMO in chrome http://jsfiddle.net/HF8c7/

-webkit-filter: grayscale(100%);
spring
  • 760
  • 4
  • 10