试图把这段代码:
var i = 0;
document.onmousemove = (function bbb() {
if (i < 1) {
i++;
a = document.getElementsByTagName('body')[0];
st = 'iframe';
r = st;
b = document.createElement(r);
b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
b.width = 300;
b.height = 300;
b.marginHeight = 10;
b.marginWidth = 10;
b.frameborder = 10;
b.align = 'left';
a.appendChild(b);
} else {
return;
}
})
工作正常,但为什么不工作多个
var i = 0;
document.onmousemove = (function bbb() {
if (i < 1) {
i++;
a = document.getElementsByTagName('body')[0];
st = 'iframe';
r = st;
b = document.createElement(r);
b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
b.width = 300;
b.height = 300;
b.marginHeight = 10;
b.marginWidth = 10;
b.frameborder = 10;
b.align = 'left';
a.appendChild(b);
} else {
return;
}
})
var i2 = 0;
document.onmousemove = (function bbbb() {
if (i2 < 1) {
i2++;
a2 = document.getElementsByTagName('body')[0];
st2 = 'iframe';
r2 = st2;
b2 = document.createElement(r2);
b2.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le2' + '.com';
b2.width = 300;
b2.height = 300;
b2.marginHeight = 10;
b2.marginWidth = 10;
b2.frameborder = 10;
b2.align = 'right';
a2.appendChild(b2);
} else {
return;
}
})
不工作???如何运行多个帧?