jdubs edited this page Oct 23, 2016 · 1 revision

Table of Contents

Overview

This function allows control of elements visiblity, driven by selections in a dropdown list. Elements will be shown or hidden based on the values specified.

Signature

showIf( { [showValues] , [showElements] } )

Parameters

( showValues ) Can be either a string or an array of strings. These are the values in the dropdown that will signify that elements should be shown.

( showElements) The ID parameters of elements that should be shown or hidden.

Additional Information

In the examples below spec['Span'] is a selection spec control with options that include: Show, Another, Hide.

String Example

<p>[[Span]] <span id="Hider"> This area will be hidden </span></p>
spec['Span'].showIf({
	showValues: 'Show',
	showElements: 'Hider'
});

Array Example

<p>[[Span]] <span id="Hider"> This area will be hidden </span></p>
<p><span id="Additional">Here's another one</span></p>
spec['Span'].showIf({
	showValues: ['Show', 'Another'],
	showElements: ['Hider', 'Additional']
});

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.