Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Reload page on resize

1
2
3
4
5
<script>
$(window).resize(function() {
        location.reload();
});
</script>
https://snipt.net/embed/1512d05d3cbba71deb661a507c119be3/
https://snipt.net/raw/1512d05d3cbba71deb661a507c119be3/
1512d05d3cbba71deb661a507c119be3
text
Text only
5
2016-12-03T21:14:59
True
False
False
Dec 15, 2015 at 08:58 AM
/api/public/snipt/143077/
reload-page-on-resize
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;script&gt; </span><span id="L-2"><a name="L-2"></a>$(window).resize(function() { </span><span id="L-3"><a name="L-3"></a> location.reload(); </span><span id="L-4"><a name="L-4"></a>}); </span><span id="L-5"><a name="L-5"></a>&lt;/script&gt; </span></pre></div> </td></tr></table>
javascript, responsive

Text only

Make div same height as width javascript

1
2
3
4
5
<script>
    $('.responsive').each(function(){
        $(this).height($(this).width());
});
</script>
https://snipt.net/embed/8f0dbcf6a292830373cd910ca69cb1c9/
https://snipt.net/raw/8f0dbcf6a292830373cd910ca69cb1c9/
8f0dbcf6a292830373cd910ca69cb1c9
text
Text only
5
2016-12-10T14:29:54
True
False
False
/api/public/snipt/143076/
make-div-same-height-as-width-javascript
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;script&gt; </span><span id="L-2"><a name="L-2"></a> $(&#39;.responsive&#39;).each(function(){ </span><span id="L-3"><a name="L-3"></a> $(this).height($(this).width()); </span><span id="L-4"><a name="L-4"></a>}); </span><span id="L-5"><a name="L-5"></a>&lt;/script&gt; </span></pre></div> </td></tr></table>
javascript, responsive

Text only

Breakpoints

1
2
3
960
680
480
https://snipt.net/embed/208e4e6e437c77f0a0b49a2df8c943d3/
https://snipt.net/raw/208e4e6e437c77f0a0b49a2df8c943d3/
208e4e6e437c77f0a0b49a2df8c943d3
text
Text only
3
2016-12-11T04:47:08
True
False
False
/api/public/snipt/71529/
breakpoints
<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>960 </span><span id="L-2"><a name="L-2"></a>680 </span><span id="L-3"><a name="L-3"></a>480 </span></pre></div> </td></tr></table>
breakpoints, responsive, rwd
Copyrighted, illegal, or inappropriate content? Email [email protected].