Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your code as-is is working just fine!</p> <p>See this fiddle with your code: <strong><a href="http://jsfiddle.net/K5NJy/1/" rel="nofollow noreferrer">http://jsfiddle.net/K5NJy/1/</a></strong></p> <p>Perhaps, the problem lies where you are swapping classes on the <code>.invert</code> and <code>.reinvert</code> element(s):</p> <pre><code>$(".invert").addClass("reinvert"); // perhaps this is causing unwanted behavior $(".invert").removeClass("invert"); // perhaps this is causing unwanted behavior </code></pre> <p><em>And as @Shivan said</em>, this will work only on webkit based browsers. Others do not support filter in this form.</p> <p><strong>Edit</strong>: (<em>after your requisites of Firefox or Opera</em>)</p> <p>See this updated fiddle: <strong><a href="http://jsfiddle.net/K5NJy/5/" rel="nofollow noreferrer">http://jsfiddle.net/K5NJy/5/</a></strong></p> <p>This updated fiddle will work in <strong>Chrome, IE9 and Firefox</strong>. (I don't have Chrome installed so can't check, but webkit based browsers should anyway support it).</p> <p>As mentioned above (and also by @Shivan), Firefox (Gecko) supports only the <code>url()</code> way of filters. So you need an SVG/XML map for that to work.</p> <p>I lifted Firefox bit of code from here: <a href="https://stackoverflow.com/a/19691142/1355315">https://stackoverflow.com/a/19691142/1355315</a></p> <p>Also, note that the order of the application of css in your code will affect IE9 and Firefox. Whichever way of filter is applied last will hold. So, if <code>url()</code> one is applied last, it will work in Firefox but not in IE. So, you will have change that in fiddle to check.</p> <p>Moreover, for older IE (&lt;9) you will need to use <code>DXImageTransform.Microsoft.Invert</code>, which is deprecated in IE9 and above.</p> <p>Hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload