snipt

Ctrl+h for KB shortcuts

JavaScript

Fancybox open from needed index

$.fancybox.open($('.fancybox'), {index: 0});
https://snipt.net/embed/4d744b9fa5a28fda34ebe36ec7df5f47/
https://snipt.net/raw/4d744b9fa5a28fda34ebe36ec7df5f47/
4d744b9fa5a28fda34ebe36ec7df5f47
js
JavaScript
1
2016-09-30T20:28:30
True
False
False
Mar 22, 2014 at 07:02 AM
/api/public/snipt/123027/
fancybox-open-from-needed-index
<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 id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">.</span><span class="nx">fancybox</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;.fancybox&#39;</span><span class="p">),</span> <span class="p">{</span><span class="nx">index</span><span class="o">:</span> <span class="mi">0</span><span class="p">});</span> </span></pre></div> </td></tr></table>
box, fancy, fancybox, gallery, image, images, jquery, modal, plugin

HTML

Simple modal html

1
2
3
<a href="example" rel="smodal">sModal Link</a>

<div id="example" class="smodal">The ID of this modal should be the same as the name on the link</div>
https://snipt.net/embed/8a46fecc364d24b6593289fbaa4c7735/
https://snipt.net/raw/8a46fecc364d24b6593289fbaa4c7735/
8a46fecc364d24b6593289fbaa4c7735
html
HTML
3
2016-09-21T16:14:21
True
False
False
/api/public/snipt/24433/
simple-modal-html
<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 id="L-1"><a name="L-1"></a><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;example&quot;</span> <span class="na">rel=</span><span class="s">&quot;smodal&quot;</span><span class="nt">&gt;</span>sModal Link<span class="nt">&lt;/a&gt;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;example&quot;</span> <span class="na">class=</span><span class="s">&quot;smodal&quot;</span><span class="nt">&gt;</span>The ID of this modal should be the same as the name on the link<span class="nt">&lt;/div&gt;</span> </span></pre></div> </td></tr></table>
html, modal, simple
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.