模仿google搜索栏的一个动态div,被iframe挡住了,怎么改都出不来?……
主要代码如下:
// 创建div
var optDiv = document.createElement("DIV");
optDiv.id=_searchDiv;
document.body.appendChild(optDiv);
//设置div样式
with (optDiv.style){
position = _position;
overflow = _overflow;
width= _width;
height= _height;
top= _top+_top1;
left= _left;
background = _background;
border= _border;
display = _display;
fontsize = _fontsize;
borderColor = _borderColor;
}
//div内部代码省略
document.body.appendChild(optDiv);
var iframe = document.createElement("iframe");
iframe.id="ifm";
with(iframe.style){
position = _position;
width=0;
height= 0;
top= 0;
left= 0;
zIndex=0;
display='block';
}
document.getElementById(_searchDiv).style.zIndex="100";
document.getElementById(_searchDiv).appendChild(iframe);
开始做的时候没考虑到被挡住的问题,后来问题出现后,在网上搜了一把,有人的建议是用一个iframe做底,主要目的是让div挡住iframe,然后iframe再挡住主页面的iframe……,照着把代码改了一下,结果还是不行,郁闷中……
那位能给点解决方案 啊……困了一天了……谢谢