snipt

Ctrl+h for KB shortcuts

JavaScript

Target IE10 with jQuery

1
2
3
4
//Detect IE10 and set an appropriate <html> class, considering that IE10 doesn't have conditional classes
if (/*@[email protected]*/false && document.documentMode === 10) {
    document.documentElement.className+=' ie-10';
}
https://snipt.net/embed/1c3e25e7e89355c0fcb858ac4deb06b9/
/raw/1c3e25e7e89355c0fcb858ac4deb06b9/
1c3e25e7e89355c0fcb858ac4deb06b9
js
JavaScript
4
2016-12-10T10:58:59
True
False
True
Mar 05, 2013 at 08:28 AM
/api/public/snipt/57032/
target-ie10-with-jquery
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">//Detect IE10 and set an appropriate &lt;html&gt; class, considering that IE10 doesn&#39;t have conditional classes</span> </span><span id="L-2"><a name="L-2"></a><span class="k">if</span> <span class="p">(</span><span class="cm">/*@[email protected]*/</span><span class="kc">false</span> <span class="o">&amp;&amp;</span> <span class="nb">document</span><span class="p">.</span><span class="nx">documentMode</span> <span class="o">===</span> <span class="mi">10</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">document</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">.</span><span class="nx">className</span><span class="o">+=</span><span class="s1">&#39; ie-10&#39;</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
"internet explorer", browser, css, ie10, javascript, jquery

CSS

rgba colors in IE 7 & IE 8

1
2
3
/* found here : http://stackoverflow.com/a/3977240 */
background: rgba(255, 255, 255, 0.3); /* browsers */
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4cffffff', endColorstr='#4cffffff'); /* IE shit */
https://snipt.net/embed/6e770b31dd7181a60ba2d17f316037ac/
/raw/6e770b31dd7181a60ba2d17f316037ac/
6e770b31dd7181a60ba2d17f316037ac
css
CSS
3
2019-08-20T02:34:39
True
False
False
/api/public/snipt/43498/
rgba-colors-in-ie-7-ie-8
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c">/* found here : http://stackoverflow.com/a/3977240 */</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">background</span><span class="o">:</span> <span class="nt">rgba</span><span class="o">(</span><span class="nt">255</span><span class="o">,</span> <span class="nt">255</span><span class="o">,</span> <span class="nt">255</span><span class="o">,</span> <span class="nt">0</span><span class="nc">.3</span><span class="o">);</span> <span class="c">/* browsers */</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">filter</span><span class="o">:</span> <span class="nt">progid</span><span class="nd">:DXImageTransform</span><span class="nc">.Microsoft.gradient</span><span class="o">(</span><span class="nt">GradientType</span><span class="o">=</span><span class="nt">0</span><span class="o">,</span><span class="nt">startColorstr</span><span class="o">=</span><span class="s1">&#39;#4cffffff&#39;</span><span class="o">,</span> <span class="nt">endColorstr</span><span class="o">=</span><span class="s1">&#39;#4cffffff&#39;</span><span class="o">);</span> <span class="c">/* IE shit */</span> </span></pre></div> </td></tr></table>
"internet explorer", color, css, hack, ie7, ie8, rgba