zurb/foundation — pull request #3881 by FilmKnurd (2013-12-13 03:01:19+00:00)
Title: Allows you to configure which element to append the reveal

- Checks for the existence of rootElement in the settings object
- Uses rootElement if it is set, otherwise it appends the reveal
to

**Depends on PR:** #3743

Usage
----------

To change the element, pass in an a settings object on initialization:
```JS
$(document).foundation( 'reveal', { rootElement: '#alternate-element'})
```
Or on open:
```JS
$('#myModal').foundation( 'reveal', 'open', { rootElement: '#alternate-element' });
```
Purpose
------------
In a QUnit test environment, I needed the reveal to stay within the confines of the testing sandbox, so that the app code under test retained access to the modal.

**This feature is transparent**, if no rootElement is specified, then reveal behaves exactly as expected. But, if you need to attach the reveal to another element, then you can.