this.evnt.offsetHeight 这句话是什么意思?evnt又是什么属性?

元明 2002-02-21 03:44:52
//Object constructor

function makeNewsMenu(obj,nest){
nest=(!nest) ? "":'document.'+nest+'.'
this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.evnt.offsetHeight
this.moveIt=b_moveIt;
this.bgChange=b_bgChange;
this.slideUp=b_slideUp;
this.slideDown=b_slideDown;
this.clipTo=b_clipTo;
this.obj = obj + "Object";
eval(this.obj + "=this")
}
...全文
61 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Keng 2002-03-03
  • 打赏
  • 举报
回复
学习
flylyke 2002-02-22
  • 打赏
  • 举报
回复
看看吧这是document.getElementById的用法
flylyke 2002-02-22
  • 打赏
  • 举报
回复
Returns a reference to the first object with the specified value of the ID attribute.

Syntax

oElement = document.getElementById(sIDValue)
Parameters

sIDValue Required. String that specifies the value of an ID attribute.

Return Value

Returns the first object with the same ID attribute as the specified value.

Remarks

If the ID value belongs to a collection, the getElementById method returns the first object in the collection.

Example

This example uses the getElementById method to return the first occurrence of the ID attribute value, oDiv.

<SCRIPT>
function fnGetId(){
// Returns the first DIV element in the collection.
<!-- @ED mapovey 4/11/2000 :Is this comment in the correct format? -->
var oVDiv=document.getElementById("oDiv");
}
</SCRIPT>
<DIV ID="oDiv">Div #1</DIV>
<DIV ID="oDiv">Div #2</DIV>
<DIV ID="oDiv">Div #3</DIV>
<INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">
元明 2002-02-21
  • 打赏
  • 举报
回复
document.getElementById(obj)
这句话的意思是返回了一个对象吗?
元明 2002-02-21
  • 打赏
  • 举报
回复
再声明一下,这段代码是用在<div>标签里的。

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧