From 3a9ea05d483df06c9c1f2011fc4818aedf7c1c4f Mon Sep 17 00:00:00 2001 From: Olmo Maldonado Date: Thu, 28 Oct 2010 23:08:14 -0500 Subject: [PATCH] Clarified the power of the where argument for grab. Included Valerio's fixes. --- Docs/Element/Element.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Docs/Element/Element.md b/Docs/Element/Element.md index 794471bf..9488e1d2 100644 --- a/Docs/Element/Element.md +++ b/Docs/Element/Element.md @@ -162,7 +162,7 @@ Creates a new Element of the type passed in. } } }); - + // Using Selectors var myNewElement = new Element('a.myClass'); @@ -571,17 +571,34 @@ Appends the Element at a particular place relative to the Element's children (sp ### Examples: +##### HTML + +
+
+
+ ##### JavaScript - var myFirstElement = new Element('div', {id: 'myFirstElement'}); - var mySecondElement = new Element('div', {id: 'mySecondElement'}); + var mySecondElement = new Element('div#second'); + $('first').grab(mySecondElement); + +##### Resulting HTML + +
+
+
+
+ +##### JavaScript - myFirstElement.grab(mySecondElement); + var mySecondElement = new Element('div#second'); + myFirstElement.grab(mySecondElement, 'top'); ##### Resulting HTML -
-
+
+
+
### See Also: @@ -593,7 +610,7 @@ Appends the Element at a particular place relative to the Element's children (sp Element Method: adopt {#Element:adopt} -------------------------------------- -Works like [Element:grab](#Element:grab), but allows multiple elements to be adopted. +Works like [Element:grab](#Element:grab), but allows multiple elements to be adopted and only appended at the bottom. Inserts the passed element(s) inside the Element (which will then become the parent element). -- 2.11.4.GIT