html代码:<!doctype html><html><head><meta charset="utf-8"><title>无标题文档</title><script src="js/positionMessage.js"></script><script src="js/addLoadEvent.js"></script></head><body><p id="message">move</p></body></html>js代码:positionMessagefunction positionMessage(){ if(!document.getElementById) return false; if(!document.getElementById("message")) return false; var elem=document.getElementById("message"); elem.style.position=absolute; elem.style.left="100px"; elem.style.top="300px";}js代码:addLoadEventfunction addLoadEvent(func){var oldonload=window.onload; if(typeof window.onload!='function') {window.onload=func;}else{window.onload=function(){oldonload(); func();} } }addLoadEvent(positionMessage);
添加回答
举报
0/150
提交
取消