From 5cfd35284d182fe6666d3360c437b46b3ab575a8 Mon Sep 17 00:00:00 2001 From: John Isaacks Date: Fri, 9 Nov 2012 16:26:23 -0500 Subject: [PATCH] Add ability to set container element when creating new humane instance --- humane.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/humane.js b/humane.js index 45f39fa..2f5d8d3 100644 --- a/humane.js +++ b/humane.js @@ -53,6 +53,7 @@ this.waitForMove = o.waitForMove || false this.clickToClose = o.clickToClose || false this.forceNew = o.forceNew || false + this.container = o.container || doc.body try { this._setupEl() } // attempt to setup elements catch (e) { @@ -65,7 +66,7 @@ _setupEl: function () { var el = doc.createElement('div') el.style.display = 'none' - doc.body.appendChild(el) + this.container.appendChild(el) this.el = el this.removeEvent = ENV.bind(this.remove,this) this.transEvent = ENV.bind(this._afterAnimation,this)