js 创建html对象

it2024-07-22  52

var topObj = document.createElement('iframe');         topObj.id = 'topFrame';         topObj.frameborder = 0;         topTimer = window.setTimeout(function() { alert('topObj.src'); topObj.src = 'http://www.xfck.cn/lantian/htm/top.htm'; }, 100);                 topObj.allowtransparency = true;         topObj.style.backgroundColor = 'transparent';         topObj.style.position='absolute';         topObj.style.top='0px';         topObj.style.left='0px';         topObj.style.height='72px';         topObj.style.width='100% ';         topObj.style.zIndex = '2';         document.body.appendChild(topObj);         topObj.document.body.onmouseover = function() { ScrollTop(true); };         topObj.document.body.onmouseleave = function() { ScrollTop(false); };         bTopLoaded = true;         onresize();

转载于:https://www.cnblogs.com/yuteng/archive/2011/02/24/1963595.html

最新回复(0)