---
{
	"title": "Aléatoire",
	"language": "fr",
	"category": "Plugiciels",
	"categoryfile": "plugins",
	"description": "Choisi un des éléments enfant aléatoirement.",
	"altLangPrefix": "wb-randomize",
	"dateModified": "2020-12-09"
}
---
<p lang="en"><strong>Needs translation</strong></p>

<h2>But</h2>
<p>Choisi un des éléments enfant aléatoirement.</p>

<div lang="en">
<h2>Working example</h2>
<ul>
	<li><a href="../../../demos/wb-randomize/wb-randomize-en.html">English example</a></li>
	<li><a href="../../../demos/wb-randomize/wb-randomize-fr.html">French example</a></li>
</ul>

<h2>Evaluation and report</h2>
<p>There is no evaluation and report available for this component.</p>

<h2>API (Version 1.0)</h2>
<dl class="dl-horizontal">
	<dt>Function</dt>
	<dd>Version 1.0</dd>
	<dt>Configuration</dt>
	<dd>Version 1.0</dd>
	<dt>User interface (Template)</dt>
	<dd>Version 1.0</dd>
	<dt>Data source</dt>
	<dd>Not applicable</dd>
	<dt>View and style</dt>
	<dd>Not applicable</dd>
	<dt>i18n string</dt>
	<dd>Not applicable</dd>
</dl>

<h3>Function</h3>
<p>(Version 1.0)</p>
<table class="table">
	<tr>
		<th>Function type</th>
		<th>Name</th>
		<th>How to implement</th>
		<th>What it does</th>
	</tr>
	<tr>
		<td>jQuery Event</td>
		<td><code>wb-init.wb-randomize</code></td>
		<td>Triggered manually (e.g., <code>$( ".wb-randomize" ).trigger( "wb-init.wb-randomize" );</code>).</td>
		<td>Initializes the bg-img plugin. This plugin will be initialized automatically unless the <code>.wb-randomize</code> element is added after the page load and wet-boew was initialized.</td>
	</tr>
	<tr>
		<td>jQuery Event</td>
		<td><code>wb-ready.wb-randomize</code></td>
		<td>Triggered automatically after the plugin initializes.</td>
		<td>Used to identify when and where the plugin initializes (target of the event).
			<pre><code>$( document ).on( "wb-ready.wb-randomize", ".wb-randomize", function( event ) {
});</code></pre>
			<pre><code>$elm.on( "wb-ready.wb-randomize", function( event ) {
});</code></pre>
		</td>
	</tr>
</table>

<h3>Configuration</h3>
<p>(Version 1.0)</p>
<dl>
	<dt><code>selector</code> (jQuery selector)</dt>
	<dd>Default undefined. When undefined it selects all the children. This attribute specifies the child elements to be displayed. Cannot be used simultaneously with <code>attribute</code>.</dd>
	<dt><code>shuffle</code> (boolean)</dt>
	<dd>If true, it will shuffle the order of child components.</dd>
	<dt><code>toggle</code> (CSS class)</dt>
	<dd>Class name that will be toggled in child components and it will toggle the specified class of child components to reveal.</dd>
	<dt><code>number</code> (number)</dt>
	<dd>Optional and use with toggle. Number of child components to be displayed when toggled. Default is set to <code>1</code>.</dd>
	<dt><code>attribute</code> (string)</dt>
	<dd>Attribute to be defined on the element. Cannot be used simultaneously with <code>selector</code>.</dd>
	<dt><code>values</code> (array of strings)</dt>
	<dd>Set of possible values to be picked as the value for the attribute defined in <code>attribute</code>.</dd>
</dl>

<h3>User interface (Template)</h3>
<p>(Version 1.0)</p>
<ul>
	<li>
		<p>Attribute:</p>
		<pre><code>data-wb-randomize</code></pre>
	</li>
</ul>

<h2>Source code</h2>
<p><a href="https://github.com/wet-boew/wet-boew/tree/master/src/plugins/wb-randomize">Randomize source code on GitHub</a></p>
</div>
