现在的位置: 首页 > 综合 > 正文

js 创建html对象

2012年04月06日 ⁄ 综合 ⁄ 共 745字 ⁄ 字号 评论关闭
        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();

抱歉!评论已关闭.