请问pixelTop和top有什么区别
问一下html元素中pixeltop和top,pixelleft和left
请问他们和元素的height,width有联系吗
另外screen.height和screen.availheight
screen.width和screen.availwidth
有什么区别
还有我怎么取屏幕的分辩率
问题点数:20、回复次数:11Top
1 楼net_lover(【孟子E章】)回复于 2002-04-10 11:22:40 得分 2
window.screen.Width
window.screen.HeightTop
2 楼8988(晓月)回复于 2002-04-10 11:25:17 得分 5
用window.document.body对象时
offsetWidth、offsetHeight IE工作区宽和高
clientWidth、clientHeight IE可见区宽和高
scrollWidth、scrollHeight IE水平滚动板宽度和垂直滚动板高度
screen.width、screen.height 屏幕的分辩率
Top
3 楼net_lover(【孟子E章】)回复于 2002-04-10 11:25:18 得分 4
top的值是String
pixelTop的值是IntegerTop
4 楼net_lover(【孟子E章】)回复于 2002-04-10 11:25:31 得分 0
top的值是String
pixelTop的值是IntegerTop
5 楼karma(无为MS MVP)回复于 2002-04-10 11:28:36 得分 4
left (x),top (y)是带单位的值,pixelLeft,pixelTop是不带单位的值
屏幕的分辩率(单位是pixel):
screen.width
screen.height
screen.availWidth, screen.availHeight是指除去TASKBAR以外的长宽
Top
6 楼zlgun(自由人)回复于 2002-04-10 11:38:13 得分 3
这是msdn对pixelTop的解释
The pixelTop property reflects the value of the Cascading Style Sheets (CSS) top attribute. Use the offsetTop property to calculate actual positions within the document area.
Unlike the top property, the pixelTop value is an integer, not a string, and is always interpreted in pixels.
Because the value of the top property is a string, you cannot use the property in script to calculate the position of the object in the document; instead, use the pixelTop or the posTop property.
pixelleft和left的关系也是如此(类型不同)
screen.width和screen.height返回的就是屏幕的分辩率
screen.availwidth和screen.availheight指的是系统屏幕工作区域的宽度和高度,不包括任务栏(Retrieves the width and height of the working area of the system's screen, excluding the Microsoft Windows taskbar. )
当你把任务栏设为自动隐藏时screen.availwidth和screen.availheight的值与screen.width和screen.height相同Top
7 楼jhtisboy(容易受伤的男人)回复于 2002-04-10 12:38:43 得分 0
请问一下pixeltop是相对于父对象的吗
比如我在一个层中嵌套了一个层
那么子层的pixeltop是相对于父层的吗Top
8 楼zlgun(自由人)回复于 2002-04-10 13:51:59 得分 2
yes
pixeltop是相对于父层的
Top
9 楼jhtisboy(容易受伤的男人)回复于 2002-04-10 14:41:18 得分 0
请问一个页面中我嵌套在不同层中的两个子层能不能用同一个idTop
10 楼zlgun(自由人)回复于 2002-04-10 15:22:06 得分 0
The id should be unique throughout the scope of the current document. If a document contains more than one object with the same identifier, the objects are exposed as a collection that can be referenced only in ordinal position
自己翻译一下吧,这是MSDN上的原话Top
11 楼jhtisboy(容易受伤的男人)回复于 2002-04-10 16:40:25 得分 0
我现在有一个图,可以看成一个小按钮,我想让他停在层中的一个地方
请问如何写Top




