Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

CSS

CSS Floating Next Button

1
2
3
#form-pagebreak-back_91, #form-pagebreak-next_91, #form-pagebreak-back_92, #form-pagebreak-next_92,
#form-pagebreak-back_95, #form-pagebreak-next_95,
#form-pagebreak-back_98, #form-pagebreak-next_98{position:fixed;bottom:3px;left:600px;background:#fff4c8;border:2px solid #ffcc00;width:150px;z-index:100;}
https://snipt.net/embed/4fd9c80d96a9454993601134476d1769/
https://snipt.net/raw/4fd9c80d96a9454993601134476d1769/
4fd9c80d96a9454993601134476d1769
css
CSS
3
2016-12-03T23:08:07
True
False
False
Mar 23, 2016 at 12:12 PM
/api/public/snipt/144903/
css-floating-next-button
<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="nn">#form-pagebreak-back_91</span><span class="o">,</span> <span class="nn">#form-pagebreak-next_91</span><span class="o">,</span> <span class="nn">#form-pagebreak-back_92</span><span class="o">,</span> <span class="nn">#form-pagebreak-next_92</span><span class="o">,</span> </span><span id="L-2"><a name="L-2"></a><span class="nn">#form-pagebreak-back_95</span><span class="o">,</span> <span class="nn">#form-pagebreak-next_95</span><span class="o">,</span> </span><span id="L-3"><a name="L-3"></a><span class="nn">#form-pagebreak-back_98</span><span class="o">,</span> <span class="nn">#form-pagebreak-next_98</span><span class="p">{</span><span class="nb">position</span><span class="o">:</span><span class="nb">fixed</span><span class="p">;</span><span class="nb">bottom</span><span class="o">:</span><span class="m">3px</span><span class="p">;</span><span class="nb">left</span><span class="o">:</span><span class="m">600px</span><span class="p">;</span><span class="nb">background</span><span class="o">:</span><span class="m">#fff4c8</span><span class="p">;</span><span class="nb">border</span><span class="o">:</span><span class="m">2px</span> <span class="nb">solid</span> <span class="m">#ffcc00</span><span class="p">;</span><span class="nb">width</span><span class="o">:</span><span class="m">150px</span><span class="p">;</span><span class="nb">z-index</span><span class="o">:</span><span class="m">100</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
button, css, floating, next

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-04T02:33:30
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

JavaScript

jQuery Click

1
2
3
4
5
6
7
function XLS_DL_ClickListener() {
    $("a#download_xls").click(function() {
        $("#m2_MB_btnSubmit2").trigger('click');

        return false;
    });
}
https://snipt.net/embed/d9f530e9a1b9c092b306c21d6998d260/
https://snipt.net/raw/d9f530e9a1b9c092b306c21d6998d260/
d9f530e9a1b9c092b306c21d6998d260
js
JavaScript
7
2016-12-02T07:55:09
True
False
False
Jan 19, 2013 at 10:20 AM
/api/public/snipt/54025/
jquery-click
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">XLS_DL_ClickListener</span><span class="p">()</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="s2">&quot;a#download_xls&quot;</span><span class="p">).</span><span class="nx">click</span><span class="p">(</span><span class="kd">function</span><span class="p">()</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="s2">&quot;#m2_MB_btnSubmit2&quot;</span><span class="p">).</span><span class="nx">trigger</span><span class="p">(</span><span class="s1">&#39;click&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">});</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
button, click, jquery, trigger

ActionScript 3

AS3 Click Tag

click_btn.addEventListener(
  MouseEvent.CLICK,
  function():void {
    
    if (root.loaderInfo.parameters.clickTag.substr(0,5) == "http:") {
		navigateToURL(
		new URLRequest(root.loaderInfo.parameters.clickTag), "_blank"
		);
	}
	
  }
);
https://snipt.net/embed/620c86068f96a53486e1fe343a53ae15/
https://snipt.net/raw/620c86068f96a53486e1fe343a53ae15/
620c86068f96a53486e1fe343a53ae15
as3
ActionScript 3
1
2016-12-02T07:55:34
True
False
False
Jul 12, 2012 at 03:41 PM
/api/public/snipt/43838/
as3-click-tag
<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> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a> <a href="#L-12">12</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">click_btn</span><span class="o">.</span><span class="na">addEventListener</span><span class="o">(</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">MouseEvent</span><span class="o">.</span><span class="na">CLICK</span><span class="o">,</span> </span><span id="L-3"><a name="L-3"></a> <span class="kd">function</span><span class="o">():</span><span class="kc">void</span> <span class="o">{</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="k">if</span> <span class="o">(</span><span class="n">root</span><span class="o">.</span><span class="na">loaderInfo</span><span class="o">.</span><span class="na">parameters</span><span class="o">.</span><span class="na">clickTag</span><span class="o">.</span><span class="na">substr</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span><span class="mi">5</span><span class="o">)</span> <span class="o">==</span> <span class="s2">&quot;http:&quot;</span><span class="o">)</span> <span class="o">{</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">navigateToURL</span><span class="o">(</span> </span><span id="L-7"><a name="L-7"></a> <span class="k">new</span> <span class="kt">URLRequest</span><span class="o">(</span><span class="n">root</span><span class="o">.</span><span class="na">loaderInfo</span><span class="o">.</span><span class="na">parameters</span><span class="o">.</span><span class="na">clickTag</span><span class="o">),</span> <span class="s2">&quot;_blank&quot;</span> </span><span id="L-8"><a name="L-8"></a> <span class="o">);</span> </span><span id="L-9"><a name="L-9"></a> <span class="o">}</span> </span><span id="L-10"><a name="L-10"></a> </span><span id="L-11"><a name="L-11"></a> <span class="o">}</span> </span><span id="L-12"><a name="L-12"></a><span class="o">);</span> </span></pre></div> </td></tr></table>
as3, button
Copyrighted, illegal, or inappropriate content? Email [email protected].