js 创建html对象

        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();
posted @ 2011-02-24 11:36  雨藤  阅读(2815)  评论(0编辑  收藏  举报