0

I'm using object.style.filter='Gray', object.style.filter='fliph', object.style.filter='flipv', object.style.filter='invert' this is working in IE, but in firefox its not working. Can u help for this.

Subash
  • 61
  • 1
  • 2
  • 9

2 Answers2

2

.style.filter in Firefox exposes the filter CSS property that SVG defines. Valid values for this property do not include 'Gray'. See http://www.w3.org/TR/SVG11/filters.html#FilterProperty and https://developer.mozilla.org/en/applying_svg_effects_to_html_content#Example.3a.c2.a0Filtering

Boris Zbarsky
  • 34,758
  • 5
  • 52
  • 55
0

Filters are IE specific. CSS will work to set the color in both IE and FF:

object.style.backgroundColor = 'gray'

If your goal is to tint the entire div, your best bet is to create a new div which covers the first, and is partially transparent.

Zack Bloom
  • 8,309
  • 2
  • 20
  • 27
  • @Zake It's not working in firefox, but also it apply as a background. Inside the div any image is there, that thing also i want to change the color, like as shade. – Subash Aug 25 '11 at 04:33
  • Ah, then the best way to do it is to use a partially opaque div in front of the first, here is an example: http://stackoverflow.com/questions/4416007/jquery-there-is-a-way-to-apply-colour-tint-to-an-image/4416015#4416015 – Zack Bloom Aug 25 '11 at 22:12