Thanks Sandy, hopefully the following example demonstrates why I need to use Wraps instead of Inject: http://jsfiddle.net/m92Lu/6/
The example has been cleaned up so I now uses classes and divs are no longer used. It also uses examples of what the output should be compared to what is currently happening. On Monday, 14 January 2013 16:59:19 UTC, Sanford Whiteman wrote: > > > <span class="clicked"> > > <div id="clickme">Click Me</div> > > </span> > > > Whereas I need it the other way round like so: > > <span class="clickme"> > > <div id="clicked">Click Me</div> > > </span> > > SPANs can't contain DIVs, so this is a misleading goal. > > > These two new element need to sit inside the 'clicked' element so > > the render order is kept, allowing the background graphics to show > > above the background colour placed on the 'clickme' element. You > > kindly pointed out that the order created by your suggestion would > > be a problem which is why the order is important in the example, > > ensuring the final result shows the background colour changing to blue > is the main goal. > > At some point, this became overcomplicated with too much verbal > description (usually a good thing, but I'm lost). > > Is this output close to what you want? > > http://jsfiddle.net/m92Lu/5/ > > If not, please create some dummy HTML in the Fiddle to show what exact > text you expect to see in the SPANs (is it all the current innerText > of the DIV or what?). And I'm seeing textual references to flipping > multiple elements' classes between 'clicked' and 'clickme', but then > in your own code you simply add 'clicked' to new elements (as opposed > to making the new elements clickable and the old ones the style > targets). > > > The last question in my head is whether the issue I had with wrap > > is a bug within Mootools itself or I was simply misunderstanding its > > use and performing an illegal operation? > > It's a bug. > > -- Sandy > >