Randomize

Questions or comments?

Purpose

Randomly picks one of the child elements.

Working example

Evaluation and report

There is no evaluation and report available for this component.

API (Version 1.0)

Function
Version 1.0
Configuration
Version 1.0
User interface (Template)
Version 1.0
Data source
Not applicable
View and style
Not applicable
i18n string
Not applicable

Function

(Version 1.0)

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

Configuration

(Version 1.0)

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

User interface (Template)

(Version 1.0)

Source code

Randomize source code on GitHub

Date modified: