开发者

Mootools each() strange behaviour in IE6/7

开发者 https://www.devze.com 2023-03-17 08:55 出处:网络
I have a very simple piece of Mootools code to inject an element into every element with a certain class - this works without fault on Chrome, FF, IE8 and 9, however in 6 and 7 strange things happen.

I have a very simple piece of Mootools code to inject an element into every element with a certain class - this works without fault on Chrome, FF, IE8 and 9, however in 6 and 7 strange things happen.

In IE6 the element is injected but doesn't render, and as far as I can tel开发者_如何转开发l in IE7 the element isn't injected at all. Does anyone know why this might be?

All I'm doing to do the inject is

var topTable = new Element('table.top');

$$('.box_rounded').each(function(el, index) {
    topTable.clone().inject(el, 'top');
});

I have a simple example here http://jsfiddle.net/bstZQ/2/


to render a table in IE6/7 you need to populate it.

var topTable = new Element('table.top[html=<tbody><tr><td>hi</td></tr></tbody>]');

and it renders just fine. http://jsfiddle.net/bstZQ/5/

0

精彩评论

暂无评论...
验证码 换一张
取 消