Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Toggle class on hover

1
2
3
4
5
6
$('.btn').hover(function(){
		$(this).addClass('hover');
	}, 
    function(){
		$(this).removeClass('hover');
	});
https://snipt.net/embed/ef004478383f2d1c85b0e95a2408d336/
https://snipt.net/raw/ef004478383f2d1c85b0e95a2408d336/
ef004478383f2d1c85b0e95a2408d336
js
JavaScript
6
2016-12-07T09:20:13
True
False
False
Jan 31, 2014 at 04:09 AM
/api/public/snipt/109801/
toggle-class-on-hover
<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> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;.btn&#39;</span><span class="p">).</span><span class="nx">hover</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">addClass</span><span class="p">(</span><span class="s1">&#39;hover&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="p">},</span> </span><span id="L-4"><a name="L-4"></a> <span class="kd">function</span><span class="p">(){</span> </span><span id="L-5"><a name="L-5"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">removeClass</span><span class="p">(</span><span class="s1">&#39;hover&#39;</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">});</span> </span></pre></div> </td></tr></table>
button, class, css, hover, jquery

Text only

Hover Caption

http://ryun.github.io/HCaptions/
https://snipt.net/embed/67eadf92b42875d619c08435d02682a6/
https://snipt.net/raw/67eadf92b42875d619c08435d02682a6/
67eadf92b42875d619c08435d02682a6
text
Text only
1
2016-12-07T04:37:45
True
False
False
Dec 05, 2013 at 07:52 AM
/api/public/snipt/98728/
hover-caption
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>http://ryun.github.io/HCaptions/ </span></pre></div> </td></tr></table>
"box hover", captions, hover

JavaScript

Slide down navigation

1
2
3
4
5
6
7
8
$('#nav ul li').hover(function(){
	$(this).addClass('hover');
	$(this).children('ul').stop(true,true).fadeIn(300);
},
function() {
	$(this).children('ul').delay(200).fadeOut(300);
	$(this).removeClass('hover');
});
https://snipt.net/embed/f207904ab6c9562a0266bea0a4d4c88b/
https://snipt.net/raw/f207904ab6c9562a0266bea0a4d4c88b/
f207904ab6c9562a0266bea0a4d4c88b
js
JavaScript
8
2016-12-03T21:04:53
True
False
False
/api/public/snipt/58631/
slide-down-navigation
<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> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#nav ul li&#39;</span><span class="p">).</span><span class="nx">hover</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">addClass</span><span class="p">(</span><span class="s1">&#39;hover&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">children</span><span class="p">(</span><span class="s1">&#39;ul&#39;</span><span class="p">).</span><span class="nx">stop</span><span class="p">(</span><span class="kc">true</span><span class="p">,</span><span class="kc">true</span><span class="p">).</span><span class="nx">fadeIn</span><span class="p">(</span><span class="mi">300</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="p">},</span> </span><span id="L-5"><a name="L-5"></a><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> </span><span id="L-6"><a name="L-6"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">children</span><span class="p">(</span><span class="s1">&#39;ul&#39;</span><span class="p">).</span><span class="nx">delay</span><span class="p">(</span><span class="mi">200</span><span class="p">).</span><span class="nx">fadeOut</span><span class="p">(</span><span class="mi">300</span><span class="p">);</span> </span><span id="L-7"><a name="L-7"></a> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">removeClass</span><span class="p">(</span><span class="s1">&#39;hover&#39;</span><span class="p">);</span> </span><span id="L-8"><a name="L-8"></a><span class="p">});</span> </span></pre></div> </td></tr></table>
hover, javascript, jquery, menu, nav, navigation, slide
Copyrighted, illegal, or inappropriate content? Email [email protected].