You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vestride_Shuffle/_includes/events.html

30 lines
1.5 KiB
HTML

<h2>Events<a href="#events"></a></h2>
<p>A list of events shuffle triggers:</p>
<ul>
<li><code class="language-javascript">'loading.shuffle'</code></li>
<li><code class="language-javascript">'done.shuffle'</code></li>
<li><code class="language-javascript">'shrink.shuffle'</code></li>
<li><code class="language-javascript">'shrunk.shuffle'</code></li>
<li><code class="language-javascript">'filter.shuffle'</code></li>
<li><code class="language-javascript">'filtered.shuffle'</code></li>
<li><code class="language-javascript">'layout.shuffle'</code></li>
<li><code class="language-javascript">'removed.shuffle'</code></li>
</ul>
<h3>Get notified when shuffle is done with setup</h3>
<p>To receive the <code>loading</code> and <code>done</code> events, you must subscribe to them before initializing the plugin, otherwise they will fire before you have subscribed to them</p>
<pre rel="JavaScript"><code class="language-javascript">$grid.on('done.shuffle', function() {
console.log('Finished initializing shuffle!');
});
// Initialize shuffle
$grid.shuffle( options );</code></pre>
<h3>Do something when an item is removed</h3>
<pre rel="JavaScript"><code class="language-javascript">$grid.on('removed.shuffle', function( evt, $collection, shuffle ) {
console.log( this, evt, $collection, shuffle );
});</code></pre>
<p class="demo-link-container">Check out the <a href="#demo">demo</a> at the top of the page, or its <a href="/js/demos/homepage.js">JavaScript file.</a></p>