2021.1

Table Of Contents
If you call prev() or next() on a single element (this in an 'Each matched element' script), and
the element has no previous or next sibling, the function returns null. Performing an operation
on a null value will result in an error, which means that the rest of the script won't be executed.
In this case, it is useful to check the return value, unless it's certain that it will never be null.
Example
Assume that there are three consecutive paragraphs in a Box and that the second of those
paragraphs has an ID that matches the selector of this script. The paragraph is stored in the
results object (see "results" on page1427). The following script changes the font-weight of the
next paragraph - the third paragraph in the Box - to bold.
results.next().css("font-weight", "bold");
If the elements in results don't have siblings, this line of code will have no effect. It also won't
result in an error.
In an 'Each matched element' script you would first need to check the return value of this.next():
var nextSibling = this.next();
if nextSibling != null { nextSibling.css("font-weight", "bold"); }
overflows()
The overflows() method returns a boolean value indicating whether an HTML element
overflows its box boundaries.
This function could for instance be used in a design where content needs to flow separately
from the main text flow, or where a new, full-page, multi-column box should be inserted when
the current one overflows.
Note that when called in a Standard script, this method runs before the pagination of Print
output. After pagination - in the output, and in Preview mode - the element's overflow may have
changed, especially when the element is combined with floating elements (i.e. elements that
have the CSS style float) and located near a page-break.
To prevent this from happening, it may help to set the element's CSS style to overflow:hidden.
The overflows() method can also be used in a Post Pagination script.
Page 1371