2022.1

Table Of Contents
Showing or hiding several elements with one conditional script
To apply one conditional content script to several elements, a CSS class or HTMLelement
needs to be used as the selector of the script. When you select multiple elements and create a
new conditional content script following the actions described in "Showing or hiding elements
using the Conditional Content Script wizard" on page355, a CSS class will be applied
automatically.
If you have created the script yourself, or if you want a script to apply to more elements later on,
you have to do this manually.
1. Double-click the conditional script in the Scripts pane to reopen it.
2. Make sure that the selector is a CSS class (for example, .male) or an HTML element with
a certain CSS class (for example, p.male). See "Using the Text Script Wizard" on
page349 for further explanation on selectors.
3. Apply the same CSS class to all elements that should be shown or hidden under the
condition that you have set in the conditional script. Click each element and type the class
(without the preceding dot) in the Class field.
Showing or hiding a text selection
When you right-click on an element and make it conditional, the element as a whole will be
made conditional. This happens even when you select a few words in a paragraph and right-
click those words; the paragraph as a whole will be made conditional.
It is, however, possible to show or hide a part of a paragraph.
If the text that you want to show or hide is short, you could use the Selector and Text option in
the Conditional Content wizard and copy the text into the Text field. This option uses the
specified selector as a trigger for the script. The script applies to all instances of the text found
within the specified selector.
Searching for text can be a lengthy operation, compared to searching for an element with an ID.
If performance is an issue, of if the search text is long, a better alternative is to wrap the text in a
span element first.
1. Select the part of the text that you want to make conditional.
2. Right-click the selected text and click Wrap in span.
Page 358