document.defaultView 什么意思,希望详细解答一下谢谢
style.getComputedStyle(elem, "");什么意思,希望详细解答一下谢谢。
style.getComputedStyle(elem, "");什么意思,希望详细解答一下谢谢。
解决方案 »
- 今天用jquery发现一个诡异的问题?大家有遇到过的吗?
- 如何实现div内自动滚动?
- 网站首页打开时先显示进度条,同时缓存首页,等进度条完成后再显示首页该怎么做?指点下
- ==关于浏览器的刷新问题==
- 请问如何做能够兼容Mozilla Firefox的可拖放元素?(也就是鼠标能够直接在页面上通过拖动改变元素的位置)
- 求json to array并显示array!!!
- iframe中的一个复选框如何表示
- 搜索局域网内已知的的ftp站点是否开着,用脚本能不能做
- 关于JQUERY在IE6下的bug问题
- IE6下JQuery特效问题,在iframe中点击后页面后宽度变短,直至消失,求助
- js正则问题
- 也就是如何定时调用远程js? 急,请大家帮忙,非常感谢!
style.getComputedStyle(elem, ""); // 自定义方法
其他就无从知晓了。
http://hi.baidu.com/freezesoul/blog/item/f6b7e5cddede1d520fb345cc.html
这是w3c标准方法,取得元素的样式信息,因为有些样式是在外部css文件定义的,所以用ele.style是取不到的如果是ie,可以用 ele.currentStyle["name"]
Editors
Arnaud Le Hors, IBM
Laurence Cable, Sun Microsystems
Table of contents
1.1. Introduction
1.2. Interfaces
AbstractView, DocumentView
1.1. Introduction
A document may have one or more "views" associated with it, e.g., a computed view on a document after applying a CSS stylesheet, or multiple presentations (e.g., HTML Frame) of the same document in a client. That is, a view is some alternate representation of, or a presentation of, and associated with, a source document.A view may be static, reflecting the state of the document when the view was created, or dynamic, reflecting changes in the target document as they occur, subsequent to the view being created. This Level of the DOM specification makes no statement about these behaviors.This section defines an AbstractView interface which provides a base interface from which all such views shall derive. It defines an attribute which references the target document of the AbstractView. The only semantics of the AbstractView defined here create an association between a view and its target document.There are no subinterfaces of AbstractView defined in the DOM Level 2.However, AbstractView is defined in and used in this Level in two places:A Document may implement a DocumentView that has a default view attribute associated with it. This default view is typically dependent on the implementation (e.g., the browser frame rendering the document). The default view can be used in order to identify and/or associate a view with its target document (by testing object equality on the AbstractView or obtaining the DocumentView attribute).
A UIEvent typically occurs upon a view of a Document (e.g., a mouse click on a browser frame rendering a particular Document instance). A UIEvent has an AbstractView associated with it which identifies both the particular (implementation-dependent) view in which the event occurs, and the target document the UIEvent is related to.
The interfaces found within this section are not mandatory. A DOM application may use the hasFeature(feature, version) method of the DOMImplementation interface with parameter values "Views" and "2.0" (respectively) to determine whether or not this module is supported by the implementation. In order to fully support this module, an implementation must also support the "Core" feature defined defined in the Document Object Model Level 2 Core specification [DOM Level 2 Core]. Please refer to additional information about conformance in the DOM Level 2 Core specification.1.2. Interfaces
Interface AbstractView (introduced in DOM Level 2)
A base interface that all views shall derive from.
IDL Definition
// Introduced in DOM Level 2:
interface AbstractView {
readonly attribute DocumentView document;
};Attributes
document of type DocumentView, readonly
The source DocumentView of which this is an AbstractView.Interface DocumentView (introduced in DOM Level 2)
The DocumentView interface is implemented by Document objects in DOM implementations supporting DOM Views. It provides an attribute to retrieve the default view of a document.
IDL Definition
// Introduced in DOM Level 2:
interface DocumentView {
readonly attribute AbstractView defaultView;
};Attributes
defaultView of type AbstractView, readonly
The default AbstractView for this Document, or null if none available.网页地址:
http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView-defaultView