http://fason.nease.net/libary/js/javascript.zip
解决方案 »
- FF和IE就剪切、复制、粘贴和超链接的兼容问题
- apply(null,array_of_numbers) null代表什么??????
- 求教:javascript实现可编辑的图表
- javascript客户端代码,如何将某个字串用另一个字串代替,比如
- net_lover(孟子E章)请看过来,关于删除数组元素的后续问题
- 如何获得动态的layer的高度?
- 如果一个单元格的id=p,那么怎样用js控制其中字符的颜色?
- 在iframe中怎样才能得到parent中输入框的ID呢?请大家帮忙.
- 大量生成缩略图处理流畅性
- ajax问题解决
- 如何点了按钮跳转到指定页面。记不起来了:(
- 高分请教,客户端排序问题(100分)
object.clientWidthResThis property has read-only permission, meaning you can retrieve its current value, but not change it. For more information on how to access the dimension and location of elements on the page through the document object model, seeMeasuring Element Dimension and Location. Applies ToAPPLET, BODY, BUTTON, CAPTION, DIV, EMBED, FIELDSET, IMG, INPUT, LEGEND, MARQUEE, OBJECT, SPAN, TABLE, TD, TEXTAREA, TR
--------------------------------------------------------------------------------
DescriptionReturns the width of the element relative to the document's top-left corner. Syntax
object.offsetWidthResUsing a combination of offset* properties, you can determine the location, width, and height of an element by using the offsetLeft, offsetTop, offsetHeight, and offsetWidth properties. These numeric properties specify the physical coordinates and dimensions of the element relative to the element's offset parent. For example, the following document is a simple clock that adjusts the size of its readout to fit the current width and height of the document body. <HTML>
<HEAD><TITLE>A Simple Clock</TITLE>
<SCRIPT LANGUAGE="JScript">
function startClock() {
window.setInterval("Clock_Tick()", 1000);
Clock_Tick();
}var ratio = 4;
function Clock_Tick()
{
var s = Date();
var t = s.substring(11,19);
var doc_height = document.body.offsetHeight;
var doc_width = document.body.offsetWidth; if ((doc_height*ratio)>doc_width)
doc_height = doc_width / ratio;
document.all.MyTime.innerText = t;
document.all.MyTime.style.fontSize = doc_height;
}
</SCRIPT>
<BODY onload="startClock()">
<P ID="MyTime"> </P>
</BODY>
</HTML>This property has read-only permission, meaning you can retrieve its current value, but not change it. For more information on how to access the dimension and location of elements on the page through the document object model, seeMeasuring Element Dimension and Location. Applies ToA, ACRONYM, ADDRESS, APPLET, AREA, B, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, H1, H2, H3, H4, H5, H6, HR, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP pixelWidth--------------------------------------------------------------------------------DescriptionSets or retrieves the width of the element, in pixels. Unlike the width property, this property's value is an integer, not a string, and is always interpreted in pixels. Syntax
object.pixelWidth[ = pixelWidth]
SettingsThis read-write property can be any integer value. Setting this property changes the value of the height without changing the units designator. ResFor more information on how to access the dimension and location of elements on the page through the document object model, seeMeasuring Element Dimension and Location. Applies Tostyle CSS Attributewidth See Also
posWidth
--------------------------------------------------------------------------------这些是我在自己机子上找的 htmlref.chm 中的。
简单地说(有什么不对的地方请指正):
clientWidth:客户端宽(最好理解成元素宽),但不包含任何边距/间距/边框/滚动条的部分。
offsetWidth:相对于文档左上角的元素宽。
PixelWidth:象素宽,基本和Width查不多,但它是整数。看看这个,爆有用:
http://msdn.microsoft.com/workshop/graphics/dhtmlpos.gif最完则怀念感的参考资料就是MSDN啦。
还是看图示比较清楚
Returns the width of the element, in pixels. This width does not take into account any margin, border, scroll bar, or padding that might have been applied to the element.
返回,用像素,来表示的元素宽度,这个宽度不包括边框和状态条那些东东。
offsetWidth:
Returns the width of the element relative to the document's top-left corner.
返回元素的相对于窗体左上角的偏离宽度PixelWidth:
Setting this property changes the value of the width without changing the units designator. Unlike the width property, the pixelWidth value is an integer, not a string, and is always interpreted in pixels.
设置元素的宽度
和WIDTH一样,只是它是一个INT的使用像素的
上面的人都说了,
学会去查MSDNhttp://msdn.microsoft.com/workshop/author/dhtml/reference/properties/pixelwidth.asp?frame=true
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/offsetwidth.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/clientwidth.asp作为一个写程序的,MSDN是经常会用到的,
[email protected]
谢谢各位,!我不知道MSDN还会有HTML的东西,而且太大个儿,我也没必要为了HTML装这么大的家伙。有没有专门的HTML的?如果有很快就结贴,各位大哥都有分,提供完整文档的给1000分。
这个是够全的了。原来自己机器上有还找了N年。也是因为平时不怎么用比较深的东西,常用的都有模板,也不用改
这样吧,给每人开个贴,100分,如何。