GitHub - ganlanyuan/tiny-slider: Vanilla javascript slider for all purposes.
<div id=""> <p><a href="https://www.jsdelivr.com/package/npm/tiny-slider" rel="nofollow"><img src="https://camo.githubusercontent.com/441b83e404e19025ee1bcb45815082d4d7ea191220beff833d8a97812444662a/68747470733a2f2f646174612e6a7364656c6976722e636f6d2f76312f7061636b6167652f6e706d2f74696e792d736c696465722f62616467653f7374796c653d726f756e646564" alt="" data-canonical-src="https://data.jsdelivr.com/v1/package/npm/tiny-slider/badge?style=rounded"/></a> <a target="blank" rel="noopener noreferrer" href="https://camo.githubusercontent.com/c923d46825610fa7bf7ea23cf2a8f2ba617e6fc8d8147981f030f72321db52a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d322e392e332d677265656e2e737667"><img src="https://camo.githubusercontent.com/c923d46825610fa7bf7ea23cf2a8f2ba617e6fc8d8147981f030f72321db52a5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d322e392e332d677265656e2e737667" alt="version" data-canonical-src="https://img.shields.io/badge/Version-2.9.3-green.svg"/></a></p> <p>Tiny slider for all purposes, inspired by <a href="https://owlcarousel2.github.io/OwlCarousel2/" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-1">Owl Carousel</a><a href="#readabilityFootnoteLink-1" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[1]</sup></small></a>.</p> <p><a href="http://ganlanyuan.github.io/tiny-slider/demo" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-2">Demos</a><a href="#readabilityFootnoteLink-2" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[2]</sup></small></a></p> <p><a href="http://ganlanyuan.github.io/tiny-slider/test" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-3">Test results</a><a href="#readabilityFootnoteLink-3" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[3]</sup></small></a></p> <p><em>Previous versions</em>: <a href="https://github.com/ganlanyuan/tiny-slider/tree/v1">v1</a>, <a href="https://github.com/ganlanyuan/tiny-slider/tree/v0">v0</a></p> <p><strong>Warning</strong>: tiny-slider works with static content and it works in the browser only. If the HTML is loaded dynamically, make sure to call <code>tns()</code> after its loading.</p> <h2><a id="user-content-contents" class="anchor" aria-hidden="true" href="#contents"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Contents</h2> <h2><a id="user-content-whats-new" class="anchor" aria-hidden="true" href="#whats-new"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>What's new</h2> <ul> <li>Using <code>%</code> instead of <code>px</code> (No more recalculation of each slide width on window resize)</li> <li>Using CSS Mediaqueries if supported</li> <li>Save browser capability values to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-4">localStorage</a><a href="#readabilityFootnoteLink-4" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[4]</sup></small></a>, so they will not be recheck again until browser get upgraded or user clear the localStorage manually.</li> <li>More options available for <code>responsive</code>. (Start from <a href="https://github.com/ganlanyuan/tiny-slider/releases/tag/v2.1.0" style="color: inherit; text-decoration: none;" name="readabilityLink-5">v2.1.0</a><a href="#readabilityFootnoteLink-5" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[5]</sup></small></a>, <a href="https://github.com/ganlanyuan/tiny-slider/issues/53" style="color: inherit; text-decoration: none;" name="readabilityLink-6">issue 53</a><a href="#readabilityFootnoteLink-6" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[6]</sup></small></a>)</li> <li>Insert <code>controls</code> and <code>nav</code> <em>before</em> slider instead of after (<a href="https://github.com/ganlanyuan/tiny-slider/issues/4" style="color: inherit; text-decoration: none;" name="readabilityLink-7">issue 4</a><a href="#readabilityFootnoteLink-7" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[7]</sup></small></a>)</li> <li>Move <code>autoplay</code> button out of <code>nav</code> container. (Start from <a href="https://github.com/ganlanyuan/tiny-slider/releases/tag/v2.1.0" style="color: inherit; text-decoration: none;" name="readabilityLink-8">v2.1.0</a><a href="#readabilityFootnoteLink-8" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[8]</sup></small></a>)</li> <li>Some selector changes in <a href="https://github.com/ganlanyuan/tiny-slider/blob/master/src/tiny-slider.scss" style="color: inherit; text-decoration: none;" name="readabilityLink-9"><code>tiny-slider.scss</code></a><a href="#readabilityFootnoteLink-9" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[9]</sup></small></a></li> </ul> <p><em>Migrating to v2</em></p> <ul> <li>Update <code>controls</code> and / or <code>nav</code> styles based on their position changes.</li> <li>Update the <a href="https://github.com/ganlanyuan/tiny-slider/blob/master/src/tiny-slider.scss" style="color: inherit; text-decoration: none;" name="readabilityLink-10"><code>slider selectors</code></a><a href="#readabilityFootnoteLink-10" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[10]</sup></small></a> accordingly if used in your CSS or JS.</li> <li>Update styles related to <code>autoplay</code> button.</li> </ul> <p><em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-11">top↑</a><a href="#readabilityFootnoteLink-11" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[11]</sup></small></a></em></p> <h2><a id="user-content-features" class="anchor" aria-hidden="true" href="#features"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Features</h2> <table> <thead> <tr> <th rowspan="3"> </th> <th colspan="4">Carousel </th> <th rowspan="3">Gallery</th> </tr> <tr> <th colspan="3">Horizontal </th> <th rowspan="2">Vertical</th> </tr> <tr> <th>Percentage Width </th> <th>Fixed Width</th> <th>Auto Width</th> </tr> </thead> <tbody readability="1"> <tr> <td>Loop</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Rewind</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>Slide by</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>Gutter</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Edge padding</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>Center (v2.9.2+)</td> <td>✓</td> <td>✓</td> <td>✓</td> <td> </td> <td> </td> </tr> <tr> <td>Responsive</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Lazyload</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Autoplay</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Auto height</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Touch/drag</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Arrow keys</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Customize controls/nav</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Accessibility</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr readability="2"> <td>Respond to DOM visibility changes</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Custom events</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>Nested</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> Default <p><em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-12">top↑</a><a href="#readabilityFootnoteLink-12" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[12]</sup></small></a></em></p> <h2><a id="user-content-install" class="anchor" aria-hidden="true" href="#install"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Install</h2> <p><code>bower install tiny-slider</code> or <code>npm install tiny-slider</code></p> <h2><a id="user-content-usage" class="anchor" aria-hidden="true" href="#usage"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Usage</h2> <h4><a id="user-content-1-add-css-and-ie8-polyfills-if-needed" class="anchor" aria-hidden="true" href="#1-add-css-and-ie8-polyfills-if-needed"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>1. Add CSS (and IE8 polyfills if needed)</h4> <div class="highlight highlight-text-html-basic" readability="34"><pre><span class="pl-kos"><</span><span class="pl-ent">link</span> <span class="pl-c1">rel</span>="<span class="pl-s">stylesheet</span>" <span class="pl-c1">href</span>="<span class="pl-s">https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.3/tiny-slider.css</span>"<span class="pl-kos">></span> <span class="pl-c"><!--[if (lt IE 9)]><script src="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.3/min/tiny-slider.helper.ie8.js"></script><![endif]--></span></pre></div> <h4><a id="user-content-2-add-markup" class="anchor" aria-hidden="true" href="#2-add-markup"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>2. Add markup</h4> <div class="highlight highlight-text-html-basic" readability="32"><pre><span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">my-slider</span>"<span class="pl-kos">></span> <span class="pl-kos"><</span><span class="pl-ent">div</span><span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span> <span class="pl-kos"><</span><span class="pl-ent">div</span><span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span> <span class="pl-kos"><</span><span class="pl-ent">div</span><span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span> <span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span> <span class="pl-c"><!-- or ul.my-slider > li --></span></pre></div> <h4><a id="user-content-3-call-tns" class="anchor" aria-hidden="true" href="#3-call-tns"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>3. Call tns()</h4> <p>Option A: Add tiny-slider.js to your page:</p> <div class="highlight highlight-text-html-basic" readability="33"><pre><span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span> <span class="pl-c"><!-- NOTE: prior to v2.2.1 tiny-slider.js need to be in <body> --></span></pre></div> <p>Option B: Import <code>tns</code> via <code>webpack</code> or <code>rollup</code>:</p> <div class="highlight highlight-source-js" readability="7"><pre><span class="pl-c">// yourScript.js</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">tns</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./nodemodules/tiny-slider/src/tiny-slider"</span></pre></div> <p>Option C: Import <code>tns</code> directly start from v2.8.2</p> <div class="highlight highlight-text-html-basic" readability="36"><pre><span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">type</span>="<span class="pl-s">module</span>"<span class="pl-kos">></span> <span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">tns</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./src/tiny-slider.js'</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">slider</span> <span class="pl-c1">=</span> <span class="pl-en">tns</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">container</span>: <span class="pl-s">'.my-slider'</span><span class="pl-kos">,</span> <span class="pl-c1">items</span>: <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">slideBy</span>: <span class="pl-s">'page'</span><span class="pl-kos">,</span> <span class="pl-c1">autoplay</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span></pre></div> <p><em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-13">top↑</a><a href="#readabilityFootnoteLink-13" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[13]</sup></small></a></em></p> <h2><a id="user-content-options" class="anchor" aria-hidden="true" href="#options"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Options</h2> <table> <thead> <tr> <th>Option</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody readability="81.800743494424"> <tr readability="2"> <td><code>container</code></td> <td>Node | String</td> <td>Default: <code>'.slider'</code>. <br/>The slider container element or selector.</td> </tr> <tr readability="4"> <td><code>mode</code></td> <td>"carousel" | "gallery"</td> <td>Default: "carousel". <br/>Controls animation behaviour. <br/>With <code>carousel</code> everything slides to the side, while <code>gallery</code> uses fade animations and changes all slides at once.</td> </tr> <tr readability="4"> <td><code>axis</code></td> <td>"horizontal" | "vertical"</td> <td>Default: "horizontal". <br/>The axis of the slider.</td> </tr> <tr readability="4"> <td><code>items</code></td> <td>positive number</td> <td>Default: 1. <br/>Number of slides being displayed in the viewport. <br/>If slides less or equal than <code>items</code>, the slider won't be initialized.</td> </tr> <tr readability="2"> <td><code>gutter</code></td> <td>positive integer</td> <td>Default: 0. <br/>Space between slides (in "px").</td> </tr> <tr readability="2"> <td><code>edgePadding</code></td> <td>positive integer</td> <td>Default: 0. <br/>Space on the outside (in "px").</td> </tr> <tr readability="2"> <td><code>fixedWidth</code></td> <td>positive integer | false</td> <td>Default: false. <br/>Controls <code>width</code> attribute of the slides.</td> </tr> <tr readability="3"> <td><code>autoWidth</code></td> <td>Boolean</td> <td>Default: false. <br/>If <code>true</code>, the width of each slide will be its natural width as a <code>inline-block</code> box.</td> </tr> <tr readability="4"> <td><code>viewportMax</code> (was <code>fixedWidthViewportWidth</code>)</td> <td>positive integer | false</td> <td>Default: false. <br/>Maximum viewport width for <code>fixedWidth</code>/<code>autoWidth</code>.</td> </tr> <tr readability="2"> <td><code>slideBy</code></td> <td>positive number | "page"</td> <td>Default: 1. <br/>Number of slides going on one "click".</td> </tr> <tr readability="2"> <td><code>center</code> (v2.9.2+)</td> <td>Boolean</td> <td>Default: false. <br/>Center the active slide in the viewport.</td> </tr> <tr readability="7"> <td><code>controls</code></td> <td>Boolean</td> <td>Default: true. <br/>Controls the display and functionalities of <code>controls</code> components (prev/next buttons). If <code>true</code>, display the <code>controls</code> and add all functionalities. <br/>For better accessibility, when a prev/next button is focused, user will be able to control the slider using left/right arrow keys.</td> </tr> <tr readability="2"> <td><code>controlsPosition</code></td> <td>"top" | "bottom"</td> <td>Default: "top". <br/>Controls <code>controls</code> position.</td> </tr> <tr readability="3"> <td><code>controlsText</code></td> <td>(Text | Markup) Array</td> <td>Default: ["prev", "next"]. <br/>Text or markup in the prev/next buttons.</td> </tr> <tr readability="3"> <td><code>controlsContainer</code></td> <td>Node | String | false</td> <td>Default: false. <br/>The container element/selector around the prev/next buttons. <br/><code>controlsContainer</code> must have at least 2 child elements.</td> </tr> <tr readability="3"> <td><code>prevButton</code></td> <td>Node | String | false</td> <td>Default: false. <br/>Customized previous buttons. <br/>This option will be ignored if <code>controlsContainer</code> is a Node element or a CSS selector.</td> </tr> <tr readability="3"> <td><code>nextButton</code></td> <td>Node | String | false</td> <td>Default: false. <br/>Customized next buttons. <br/>This option will be ignored if <code>controlsContainer</code> is a Node element or a CSS selector.</td> </tr> <tr readability="4"> <td><code>nav</code></td> <td>Boolean</td> <td>Default: true. <br/>Controls the display and functionalities of <code>nav</code> components (dots). If <code>true</code>, display the <code>nav</code> and add all functionalities.</td> </tr> <tr readability="2"> <td><code>navPosition</code></td> <td>"top" | "bottom"</td> <td>Default: "top". <br/>Controls <code>nav</code> position.</td> </tr> <tr readability="3"> <td><code>navContainer</code></td> <td>Node | String | false</td> <td>Default: false. <br/>The container element/selector around the dots. <br/><code>navContainer</code> must have at least same number of children as the slides.</td> </tr> <tr readability="4"> <td><code>navAsThumbnails</code></td> <td>Boolean</td> <td>Default: false. <br/>Indicate if the dots are thumbnails. If <code>true</code>, they will always be visible even when more than 1 slides displayed in the viewport.</td> </tr> <tr readability="2"> <td><code>arrowKeys</code></td> <td>Boolean</td> <td>Default: false. <br/>Allows using arrow keys to switch slides.</td> </tr> <tr readability="2"> <td><code>speed</code></td> <td>positive integer</td> <td>Default: 300. <br/>Speed of the slide animation (in "ms").</td> </tr> <tr readability="2"> <td><code>autoplay</code></td> <td>Boolean</td> <td>Default: false. <br/>Toggles the automatic change of slides.</td> </tr> <tr readability="2"> <td><code>autoplayPosition</code></td> <td>"top" | "bottom"</td> <td>Default: "top". <br/>Controls <code>autoplay</code> position.</td> </tr> <tr readability="2"> <td><code>autoplayTimeout</code></td> <td>positive integer</td> <td>Default: 5000. <br/>Time between 2 <code>autoplay</code> slides change (in "ms").</td> </tr> <tr readability="2"> <td><code>autoplayDirection</code></td> <td>"forward" | "backward"</td> <td>Default: "forward". <br/>Direction of slide movement (ascending/descending the slide index).</td> </tr> <tr readability="3"> <td><code>autoplayText</code></td> <td>Array (Text | Markup)</td> <td>Default: ["start", "stop"]. <br/>Text or markup in the autoplay start/stop button.</td> </tr> <tr readability="2"> <td><code>autoplayHoverPause</code></td> <td>Boolean</td> <td>Default: false. <br/>Stops sliding on mouseover.</td> </tr> <tr readability="2"> <td><code>autoplayButton</code></td> <td>Node | String | false</td> <td>Default: false. <br/>The customized autoplay start/stop button or selector.</td> </tr> <tr readability="3"> <td><code>autoplayButtonOutput</code></td> <td>Boolean</td> <td>Default: true. <br/>Output <code>autoplayButton</code> markup when <code>autoplay</code> is true but a customized <code>autoplayButton</code> is not provided.</td> </tr> <tr readability="4.4345238095238"> <td><code>autoplayResetOnVisibility</code></td> <td>Boolean</td> <td>Default: true. <br/>Pauses the sliding when the page is invisible and resumes it when the page become visiable again. (<a href="https://developer.mozilla.org/en-US/docs/Web/API/PageVisibilityAPI" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-14">Page Visibility API</a><a href="#readabilityFootnoteLink-14" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[14]</sup></small></a>)</td> </tr> <tr readability="2"> <td><code>animateIn</code></td> <td>String</td> <td>Default: "tns-fadeIn". <br/>Name of intro animation <code>class</code>.</td> </tr> <tr readability="2"> <td><code>animateOut</code></td> <td>String</td> <td>Default: "tns-fadeOut". <br/>Name of outro animation <code>class</code>.</td> </tr> <tr readability="2"> <td><code>animateNormal</code></td> <td>String</td> <td>Default: "tns-normal". <br/>Name of default animation <code>class</code>.</td> </tr> <tr readability="2"> <td><code>animateDelay</code></td> <td>positive integer | false</td> <td>Default: false. <br/>Time between each <code>gallery</code> animation (in "ms").</td> </tr> <tr readability="2"> <td><code>loop</code></td> <td>Boolean</td> <td>Default: true. <br/>Moves throughout all the slides seamlessly.</td> </tr> <tr readability="2"> <td><code>rewind</code></td> <td>Boolean</td> <td>Default: false. <br/>Moves to the opposite edge when reaching the first or last slide.</td> </tr> <tr readability="2"> <td><code>autoHeight</code></td> <td>Boolean</td> <td>Default: false. <br/>Height of slider container changes according to each slide's height.</td> </tr> <tr readability="4.4886363636364"> <td><code>responsive</code></td> <td>Object: { <br/> breakpoint: { <br/> key: value<br/> } <br/>} | false</td> <td>Default: false. <br/>Breakpoint: Integer.<br/>Defines options for different viewport widths (see <a href="#responsive-options" style="color: inherit; text-decoration: none;" name="readabilityLink-15">Responsive Options</a>). <br/><a href="#readabilityFootnoteLink-15" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[15]</sup></small></a></td> </tr> <tr readability="5.937984496124"> <td><code>lazyload</code></td> <td>Boolean</td> <td>Default: false. <br/>Enables lazyloading images that are currently not viewed, thus saving bandwidth (see <a href="http://ganlanyuan.github.io/tiny-slider/demo/#lazyloadwrapper" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-16">demo</a><a href="#readabilityFootnoteLink-16" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[16]</sup></small></a>). <br/>NOTE: <br/>+ Class <code>.tns-lazy-img</code> need to be set on every image you want to lazyload if option <code>lazyloadSelector</code> is not specified; <br/>+ <code>data-src</code> attribute with its value of the real image <code>src</code> is required; <br/>+ <code>width</code> attribute for every image is required for <code>autoWidth</code> slider.</td> </tr> <tr readability="4"> <td><code>lazyloadSelector</code> (v2.9.1+)</td> <td>String</td> <td>Default: <code>'.tns-lazy-img'</code>. <br/>The CSS selector for lazyload images.</td> </tr> <tr readability="2"> <td><code>touch</code></td> <td>Boolean</td> <td>Default: true. <br/>Activates input detection for touch devices.</td> </tr> <tr readability="2"> <td><code>mouseDrag</code></td> <td>Boolean</td> <td>Default: false. <br/>Changing slides by dragging them.</td> </tr> <tr readability="4"> <td><code>swipeAngle</code></td> <td>positive integer | Boolean</td> <td>Default: 15. <br/>Swipe or drag will not be triggered if the angle is not inside the range when set.</td> </tr> <tr readability="4"> <td><code>preventActionWhenRunning</code> (v2.9.1+)</td> <td>Boolean</td> <td>Default: false. <br/>Prevent next transition while slider is transforming.</td> </tr> <tr readability="9"> <td><code>preventScrollOnTouch</code> (v2.9.1+)</td> <td>"auto" | "force" | false</td> <td>Default: false. <br/>Prevent page from scrolling on <code>touchmove</code>. If set to "auto", the slider will first check if the touch direction matches the slider axis, then decide whether prevent the page scrolling or not. If set to "force", the slider will always prevent the page scrolling.</td> </tr> <tr readability="5.8883720930233"> <td><code>nested</code></td> <td>"inner" | "outer" | false</td> <td>Default: false. <br/>Define the relationship between nested sliders. (see <a href="http://ganlanyuan.github.io/tiny-slider/demo/#nestedwrapper" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-17">demo</a><a href="#readabilityFootnoteLink-17" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[17]</sup></small></a>) <br/>Make sure you run the inner slider first, otherwise the height of the inner slider container will be wrong.</td> </tr> <tr readability="5"> <td><code>freezable</code></td> <td>Boolean</td> <td>Default: true. <br/>Indicate whether the slider will be frozen (<code>controls</code>, <code>nav</code>, <code>autoplay</code> and other functions will stop work) when all slides can be displayed in one page.</td> </tr> <tr readability="2"> <td><code>disable</code></td> <td>Boolean</td> <td>Default: false. <br/>Disable slider.</td> </tr> <tr readability="2"> <td><code>startIndex</code></td> <td>positive integer</td> <td>Default: 0. <br/>The initial <code>index</code> of the slider.</td> </tr> <tr readability="2"> <td><code>onInit</code></td> <td>Function | false</td> <td>Default: false. <br/>Callback to be run on initialization.</td> </tr> <tr readability="2.7707006369427"> <td><code>useLocalStorage</code></td> <td>Boolean</td> <td>Default: true. <br/>Save browser capability variables to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-18">localStorage</a><a href="#readabilityFootnoteLink-18" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[18]</sup></small></a> and without detecting them everytime the slider runs if set to <code>true</code>.</td> </tr> <tr readability="3"> <td><code>nonce</code></td> <td>String / false</td> <td>Default: false. <br/>Optional Nonce attribute for inline style tag to allow slider usage without `unsafe-inline Content Security Policy source.</td> </tr> </tbody> </table> <p>NOTE: Prior to v2.0.2, options "container", "controlsContainer", "navContainer" and "autoplayButton" still need to be DOM elements. E.g. container: document.querySelector('.my-slider')</p> <p><em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-19">top↑</a><a href="#readabilityFootnoteLink-19" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[19]</sup></small></a></em></p> <h2><a id="user-content-responsive-options" class="anchor" aria-hidden="true" href="#responsive-options"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Responsive options</h2> <p>The following options can be redefined in <code>responsive</code> field: <code>startIndex</code>, <code>items</code>, <code>slideBy</code>, <code>speed</code>, <code>autoHeight</code>, <code>fixedWidth</code>, <code>edgePadding</code>, <code>gutter</code>, <code>center</code>, <code>controls</code>, <code>controlsText</code>, <code>nav</code>, <code>autoplay</code>, <code>autoplayHoverPause</code>, <code>autoplayResetOnVisibility</code>, <code>autoplayText</code>, <code>autoplayTimeout</code>, <code>touch</code>, <code>mouseDrag</code>, <code>arrowKeys</code>, <code>disable</code></p> <div class="highlight highlight-source-js" readability="14"><pre><span class="pl-c1"><</span><span class="pl-ent">script</span><span class="pl-c1">></span> var slider = tns(<span class="pl-kos">{</span> <span class="pl-s1">container</span>: <span class="pl-s">'.my-slider'</span><span class="pl-kos">,</span> <span class="pl-s1">items</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">responsive</span>: <span class="pl-kos">{</span> <span class="pl-c1">640</span>: <span class="pl-kos">{</span> <span class="pl-c1">edgePadding</span>: <span class="pl-c1">20</span><span class="pl-kos">,</span> <span class="pl-c1">gutter</span>: <span class="pl-c1">20</span><span class="pl-kos">,</span> <span class="pl-c1">items</span>: <span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">700</span>: <span class="pl-kos">{</span> <span class="pl-c1">gutter</span>: <span class="pl-c1">30</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">900</span>: <span class="pl-kos">{</span> <span class="pl-c1">items</span>: <span class="pl-c1">3</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>); <span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">script</span><span class="pl-c1">></span></pre></div> <p>NOTE:</p> <ul> <li>The breakpoints behave like <code>(min-width: breakpoint)</code> in CSS, so an undefined option will be inherited from previous small breakpoints.</li> <li><code>fixedWidth</code> can only be changed to other positive integers. It can't be changed to negative integer, 0 or other data type. <em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-20">top↑</a><a href="#readabilityFootnoteLink-20" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[20]</sup></small></a></em></li> </ul> <h2><a id="user-content-methods" class="anchor" aria-hidden="true" href="#methods"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Methods</h2> <p>The slider returns a slider object with some properties and methods once it's initialized:</p> <div class="highlight highlight-source-js" readability="19"><pre><span class="pl-kos">{</span> <span class="pl-c1">version</span>: <span class="pl-s1">version</span><span class="pl-kos">,</span> <span class="pl-c">// tiny-slider version</span> <span class="pl-c1">getInfo</span>: <span class="pl-en">info</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">events</span>: <span class="pl-s1">events</span><span class="pl-kos">,</span> <span class="pl-c">// Object</span> <span class="pl-c1">goTo</span>: <span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">play</span>: <span class="pl-en">play</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">pause</span>: <span class="pl-en">pause</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">isOn</span>: <span class="pl-s1">isOn</span><span class="pl-kos">,</span> <span class="pl-c">// Boolean</span> <span class="pl-c1">updateSliderHeight</span>: <span class="pl-en">updateInnerWrapperHeight</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">refresh</span>: <span class="pl-en">initSliderTransform</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">destroy</span>: <span class="pl-en">destroy</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">rebuild</span>: <span class="pl-en">rebuild</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p>To get the slider information, you can either use the <code>getInfo()</code> method or subscribe to an Event. Both return an Object:</p> <div class="highlight highlight-source-js" readability="31"><pre><span class="pl-kos">{</span> <span class="pl-c1">container</span>: <span class="pl-s1">container</span><span class="pl-kos">,</span> <span class="pl-c">// slider container</span> <span class="pl-c1">slideItems</span>: <span class="pl-s1">slideItems</span><span class="pl-kos">,</span> <span class="pl-c">// slides list</span> <span class="pl-c1">navContainer</span>: <span class="pl-s1">navContainer</span><span class="pl-kos">,</span> <span class="pl-c">// nav container</span> <span class="pl-c1">navItems</span>: <span class="pl-s1">navItems</span><span class="pl-kos">,</span> <span class="pl-c">// dots list</span> <span class="pl-c1">controlsContainer</span>: <span class="pl-s1">controlsContainer</span><span class="pl-kos">,</span> <span class="pl-c">// controls container</span> <span class="pl-c1">hasControls</span>: <span class="pl-s1">hasControls</span><span class="pl-kos">,</span> <span class="pl-c">// indicate if controls exist</span> <span class="pl-c1">prevButton</span>: <span class="pl-s1">prevButton</span><span class="pl-kos">,</span> <span class="pl-c">// previous button</span> <span class="pl-c1">nextButton</span>: <span class="pl-s1">nextButton</span><span class="pl-kos">,</span> <span class="pl-c">// next button</span> <span class="pl-c1">items</span>: <span class="pl-s1">items</span><span class="pl-kos">,</span> <span class="pl-c">// items on a page</span> <span class="pl-c1">slideBy</span>: <span class="pl-s1">slideBy</span> <span class="pl-c">// items slide by</span> <span class="pl-s1">cloneCount</span>: <span class="pl-s1">cloneCount</span><span class="pl-kos">,</span> <span class="pl-c">// cloned slide count</span> <span class="pl-c1">slideCount</span>: <span class="pl-s1">slideCount</span><span class="pl-kos">,</span> <span class="pl-c">// original slide count</span> <span class="pl-c1">slideCountNew</span>: <span class="pl-s1">slideCountNew</span><span class="pl-kos">,</span> <span class="pl-c">// total slide count after initialization</span> <span class="pl-c1">index</span>: <span class="pl-s1">index</span><span class="pl-kos">,</span> <span class="pl-c">// current index</span> <span class="pl-c1">indexCached</span>: <span class="pl-s1">indexCached</span><span class="pl-kos">,</span> <span class="pl-c">// previous index</span> <span class="pl-c1">displayIndex</span>: <span class="pl-en">getCurrentSlide</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c">// display index starts from 1</span> <span class="pl-c1">navCurrent</span>: <span class="pl-s1">navCurrent</span><span class="pl-kos">,</span> <span class="pl-c">// current dot index</span> <span class="pl-c1">navCurrentCached</span>: <span class="pl-s1">navCurrentCached</span><span class="pl-kos">,</span> <span class="pl-c">// previous dot index</span> <span class="pl-c1">pages</span>: <span class="pl-s1">pages</span><span class="pl-kos">,</span> <span class="pl-c">// visible nav indexes</span> <span class="pl-c1">pagesCached</span>: <span class="pl-s1">pagesCached</span><span class="pl-kos">,</span> <span class="pl-c1">sheet</span>: <span class="pl-s1">sheet</span><span class="pl-kos">,</span> <span class="pl-c1">event</span>: <span class="pl-s1">e</span> <span class="pl-c1">||</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// event object if available</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <h4><a id="user-content-getinfo" class="anchor" aria-hidden="true" href="#getinfo"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>getInfo</h4> <p>Get slider information.</p> <div class="highlight highlight-source-js" readability="12"><pre><span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">getInfo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">querySelector</span><span class="pl-kos">(</span><span class="pl-s">'.next-button'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">onclick</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// get slider info</span> <span class="pl-k">var</span> <span class="pl-s1">info</span> <span class="pl-c1">=</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">getInfo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">indexPrev</span> <span class="pl-c1">=</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">indexCached</span><span class="pl-kos">,</span> <span class="pl-s1">indexCurrent</span> <span class="pl-c1">=</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">index</span><span class="pl-kos">;</span> <span class="pl-c">// update style based on index</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">slideItems</span><span class="pl-kos">[</span><span class="pl-s1">indexPrev</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">classList</span><span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-s">'active'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">slideItems</span><span class="pl-kos">[</span><span class="pl-s1">indexCurrent</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">classList</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s">'active'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <h4><a id="user-content-goto" class="anchor" aria-hidden="true" href="#goto"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>goTo</h4> <p>Go to specific slide by number or keywords.</p> <div class="highlight highlight-source-js" readability="8"><pre><span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-s">'prev'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-s">'next'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-s">'first'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-s">'last'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">querySelector</span><span class="pl-kos">(</span><span class="pl-s">'.goto-button'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">onclick</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">goTo</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <h4><a id="user-content-play" class="anchor" aria-hidden="true" href="#play"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>play</h4> <p>Programmatically start slider autoplay when <code>autoplay: true</code>.</p> <h4><a id="user-content-pause" class="anchor" aria-hidden="true" href="#pause"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>pause</h4> <p>Programmatically stop slider autoplay when <code>autoplay: true</code>.</p> <h4><a id="user-content-updatesliderheight" class="anchor" aria-hidden="true" href="#updatesliderheight"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>updateSliderHeight</h4> <p>Manually adjust slider height when <code>autoHeight</code> is <code>true</code>.</p> <div class="highlight highlight-source-js" readability="7"><pre><span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">updateSliderHeight</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <h4><a id="user-content-destroy" class="anchor" aria-hidden="true" href="#destroy"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>destroy</h4> <p>Destroy the slider.</p> <h4><a id="user-content-rebuild" class="anchor" aria-hidden="true" href="#rebuild"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>rebuild</h4> <p>Rebuild the slider after destroy.</p> <div class="highlight highlight-source-js" readability="8"><pre><span class="pl-s1">slider</span> <span class="pl-c1">=</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-en">rebuild</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// this method returns a new slider Object with the same options with the original slider</span></pre></div> <h2><a id="user-content-custom-events" class="anchor" aria-hidden="true" href="#custom-events"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Custom Events</h2> <p>Available events include: <code>indexChanged</code>, <code>transitionStart</code>, <code>transitionEnd</code>, <code>newBreakpointStart</code>, <code>newBreakpointEnd</code>, <code>touchStart</code>, <code>touchMove</code>, <code>touchEnd</code>, <code>dragStart</code>, <code>dragMove</code> and <code>dragEnd</code>.</p> <div class="highlight highlight-source-js" readability="14"><pre><span class="pl-k">var</span> <span class="pl-en">customizedFunction</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">info</span><span class="pl-kos">,</span> <span class="pl-s1">eventName</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// direct access to info object</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">event</span><span class="pl-kos">.</span><span class="pl-c1">type</span><span class="pl-kos">,</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">container</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// bind function to event</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-c1">events</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'transitionEnd'</span><span class="pl-kos">,</span> <span class="pl-en">customizedFunction</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove function binding</span> <span class="pl-s1">slider</span><span class="pl-kos">.</span><span class="pl-c1">events</span><span class="pl-kos">.</span><span class="pl-en">off</span><span class="pl-kos">(</span><span class="pl-s">'transitionEnd'</span><span class="pl-kos">,</span> <span class="pl-en">customizedFunction</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><em><a href="#tiny-slider-2" style="color: inherit; text-decoration: none;" name="readabilityLink-21">top↑</a><a href="#readabilityFootnoteLink-21" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[21]</sup></small></a></em></p> <h4><a id="user-content-fallback" class="anchor" aria-hidden="true" href="#fallback"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Fallback</h4> <div class="highlight highlight-source-css" readability="7"><pre>.<span class="pl-c1">no-js</span> .<span class="pl-c1">your-slider</span> { <span class="pl-c1">overflow-x</span><span class="pl-kos">:</span> auto; } .<span class="pl-c1">no-js</span> .<span class="pl-c1">your-slider</span> <span class="pl-c1">></span> <span class="pl-ent">div</span> { <span class="pl-c1">float</span><span class="pl-kos">:</span> none; }</pre></div> <h2><a id="user-content-browser-support" class="anchor" aria-hidden="true" href="#browser-support"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Browser Support</h2> <p><strong>Desktop:</strong> Firefox 8+ ✓ Chrome 15+ ✓ (Should works on <em>Chrome 4-14</em> as well, but I couldn't test it.) Safari 4+ ✓ Opera 12.1+ ✓ IE 8+ ✓</p> <p><strong>Mobile:</strong> Android Browser 4.2+ ✓ Chrome Mobile 63+ ✓ Firefox Mobile 28+ ✓ Maxthon 4+ ✓</p> <h2><a id="user-content-support" class="anchor" aria-hidden="true" href="#support"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>Support</h2> <p><a href="https://www.browserstack.com/" rel="nofollow"><img src="/ganlanyuan/tiny-slider/raw/master/logos/browserstack.svg" alt="Browser Stack" width="170"/></a><br/>Live tests and Automated Tests </p><p><a href="https://crossbrowsertesting.com/" rel="nofollow"><img src="/ganlanyuan/tiny-slider/raw/master/logos/cbt.svg" width="230" alt="Cross Browser Testing"/></a><br/>Live tests, Screenshots and Automated Tests </p><p><a href="https://cdnjs.com/" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-22">Cdnjs</a><a href="#readabilityFootnoteLink-22" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[22]</sup></small></a> <br/>Images on demo page are from <a href="https://unsplash.com/" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-23">https://unsplash.com/</a><a href="#readabilityFootnoteLink-23" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[23]</sup></small></a>.</p> <h2><a id="user-content-license" class="anchor" aria-hidden="true" href="#license"><svg class="octicon octicon-link" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"/></svg></a>License</h2> <p>This project is available under the <a href="https://opensource.org/licenses/mit-license.php" rel="nofollow" style="color: inherit; text-decoration: none;" name="readabilityLink-24">MIT</a><a href="#readabilityFootnoteLink-24" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[24]</sup></small></a> license.</p> </div><div id="readability-footnotes"><h3>References</h3><ol id="readability-footnotes-list"><li><small><sup><a href="#readabilityLink-1" title="Jump to Link in Article">^</a></sup></small> <a href="https://owlcarousel2.github.io/OwlCarousel2/" rel="nofollow" name="readabilityFootnoteLink-1">Owl Carousel</a><small> (owlcarousel2.github.io)</small></li><li><small><sup><a href="#readabilityLink-2" title="Jump to Link in Article">^</a></sup></small> <a href="http://ganlanyuan.github.io/tiny-slider/demo" rel="nofollow" name="readabilityFootnoteLink-2">Demos</a><small> (ganlanyuan.github.io)</small></li><li><small><sup><a href="#readabilityLink-3" title="Jump to Link in Article">^</a></sup></small> <a href="http://ganlanyuan.github.io/tiny-slider/test" rel="nofollow" name="readabilityFootnoteLink-3">Test results</a><small> (ganlanyuan.github.io)</small></li><li><small><sup><a href="#readabilityLink-4" title="Jump to Link in Article">^</a></sup></small> <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="nofollow" name="readabilityFootnoteLink-4">localStorage</a><small> (developer.mozilla.org)</small></li><li><small><sup><a href="#readabilityLink-5" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/releases/tag/v2.1.0" name="readabilityFootnoteLink-5">v2.1.0</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-6" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/issues/53" name="readabilityFootnoteLink-6">issue 53</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-7" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/issues/4" name="readabilityFootnoteLink-7">issue 4</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-8" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/releases/tag/v2.1.0" name="readabilityFootnoteLink-8">v2.1.0</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-9" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/blob/master/src/tiny-slider.scss" name="readabilityFootnoteLink-9">tiny-slider.scss</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-10" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/ganlanyuan/tiny-slider/blob/master/src/tiny-slider.scss" name="readabilityFootnoteLink-10">slider selectors</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-11" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-11">top↑</a></li><li><small><sup><a href="#readabilityLink-12" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-12">top↑</a></li><li><small><sup><a href="#readabilityLink-13" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-13">top↑</a></li><li><small><sup><a href="#readabilityLink-14" title="Jump to Link in Article">^</a></sup></small> <a href="https://developer.mozilla.org/en-US/docs/Web/API/PageVisibilityAPI" rel="nofollow" name="readabilityFootnoteLink-14">Page Visibility API</a><small> (developer.mozilla.org)</small></li><li><small><sup><a href="#readabilityLink-15" title="Jump to Link in Article">^</a></sup></small> <a href="#responsive-options" name="readabilityFootnoteLink-15">Responsive Options</a></li><li><small><sup><a href="#readabilityLink-16" title="Jump to Link in Article">^</a></sup></small> <a href="http://ganlanyuan.github.io/tiny-slider/demo/#lazyloadwrapper" rel="nofollow" name="readabilityFootnoteLink-16">demo</a><small> (ganlanyuan.github.io)</small></li><li><small><sup><a href="#readabilityLink-17" title="Jump to Link in Article">^</a></sup></small> <a href="http://ganlanyuan.github.io/tiny-slider/demo/#nestedwrapper" rel="nofollow" name="readabilityFootnoteLink-17">demo</a><small> (ganlanyuan.github.io)</small></li><li><small><sup><a href="#readabilityLink-18" title="Jump to Link in Article">^</a></sup></small> <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="nofollow" name="readabilityFootnoteLink-18">localStorage</a><small> (developer.mozilla.org)</small></li><li><small><sup><a href="#readabilityLink-19" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-19">top↑</a></li><li><small><sup><a href="#readabilityLink-20" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-20">top↑</a></li><li><small><sup><a href="#readabilityLink-21" title="Jump to Link in Article">^</a></sup></small> <a href="#tiny-slider-2" name="readabilityFootnoteLink-21">top↑</a></li><li><small><sup><a href="#readabilityLink-22" title="Jump to Link in Article">^</a></sup></small> <a href="https://cdnjs.com/" rel="nofollow" name="readabilityFootnoteLink-22">Cdnjs</a><small> (cdnjs.com)</small></li><li><small><sup><a href="#readabilityLink-23" title="Jump to Link in Article">^</a></sup></small> <a href="https://unsplash.com/" rel="nofollow" name="readabilityFootnoteLink-23">https://unsplash.com/</a><small> (unsplash.com)</small></li><li><small><sup><a href="#readabilityLink-24" title="Jump to Link in Article">^</a></sup></small> <a href="https://opensource.org/licenses/mit-license.php" rel="nofollow" name="readabilityFootnoteLink-24">MIT</a><small> (opensource.org)</small></li></ol></div>
