不清楚哪里错了,拜托了各位大牛!感激不尽!

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代码:positionMessage

function  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代码:addLoadEvent

function addLoadEvent(func)

{var oldonload=window.onload;

 if(typeof window.onload!='function')

 {window.onload=func;}

else

{window.onload=function()

{oldonload();

  func();

}

}

}

addLoadEvent(positionMessage);


叫我Admin
浏览 1372回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript