js对象集锦.....(几个重要的但大家需要百度的)------------window对象

来源:互联网 发布:linux rpm 路径 编辑:程序博客网 时间:2024/06/10 23:16

javascript   windows对象

Represents a browser window or frame. This is the top-level object for eachdocument,Location, andHistory object group(官方英文解释)


主要事件:

  • onBlur
  • onDragDrop
  • onError
  • onFocus
  • onLoad
  • onMove
  • onResize
  • onUnload
主要属性:

closed : Specifies whether a window has been closed.  窗口是否关闭

defaultStatus :  Reflects the default message displayed in the window's status bar.  返回 窗口状态栏信息

document   :Contains information on the current document, and provides 方法s for displaying HTML output to the user.   文档对象

frames  :An array reflecting all the frames in a window.   窗口所包含的frames对象

history  :Contains information on the URLs that the client has visited within a window.   包含浏览器所访问过的url对象集合

innerHeight : Specifies the vertical dimension, in pixels, of the window's content area.   以像素px为单位返回文档区域的高度;

innerWidth  :Specifies the horizontal dimension, in pixels, of the window's content area.    以像素px为单位返回文档区域的宽度;

length  :The number of frames in the window.   窗口所包含的frames对象长度

location  :Contains information on the current URL.  当前url地址对象信息

locationbar   :Represents the browser window's location bar.   返回当前浏览器地址栏信息

menubar   : Represents the browser window's menu bar.  返回浏览器菜单栏

name   :A unique name used to refer to this window.   返回当前窗口的名称

opener    :Specifies the window name of the calling document when a window is opened using the open 

outerHeight  :Specifies the vertical dimension, in pixels, of the window's outside boundary.   返回窗口的外部边界高度(内容区域以外的)

outerWidth   :Specifies the horizontal dimension, in pixels, of the window's outside boundary.  返回窗口的外部边界宽度(内容区域以外的)

pageXOffset   :Provides the current x-position, in pixels, of a window's viewed page. 

pageYOffset   :Provides the current y-position, in pixels, of a window's viewed page.

parent   :A synonym for a window or frame whose frameset contains the current frame.   当一个frames被包含在父窗口则返回父窗口的名称

personalbar   :Represents the browser window's personal bar (also called the directories bar). 

scrollbars   :Represents the browser window's scroll bars.   浏览器滚动条对象

self   :A synonym for the current window.

status  :Specifies a priority or transient message in the window's status bar.  状态栏的瞬间信息

statusbar  :Represents the browser window's status bar.   状态栏对象

toolbar  :Represents the browser window's tool bar.

top  :A synonym for the topmost browser window.

window  :A synonym for the current window.   当前窗口对象

方法概览:

alert  :Displays an Alert dialog box with a message and an OK button.   弹出窗口(一直在用这个方法,今天才知道是window对象)
back  :Undoes the last history step in any frame within the top-level window.   返回上一次浏览记录适用于顶层窗口
blur  :Removes focus from the specified object.   移除焦点
captureEvents  :Sets the window or document to capture all events of the specified type.  捕捉鼠标事件
clearInterval  :Cancels a timeout that was set with the setInterval 方法。  清除定时器当前窗口定时器对象
clearTimeout  :Cancels a timeout that was set with thesetTimeout 方法。  
清除定时器当前窗口定时器对象
close  :Closes the specified window.  关闭窗口
confirm  :Displays a Confirm dialog box with the specified message and OK and Cancel buttons.   显示一个确认对话窗口带有确认取消按钮
disableExternalCapture  :Disables external event capturing set by theenableExternalCapture   方法。 
enableExternalCapture  :Allows a window with frames to capture events in pages loaded from different locations (servers).  允许带框架集对象的窗口捕获事件
find  :Finds the specified text string in the contents of the specified window.   在指定的窗口查找指定的字符串对象
focus  :Gives focus to the specified object.   指定焦点对象
forward  :Loads the next URL in the history list.  在浏览记录中指向下一个地址
handleEvent  :  调用指定事件的控制句柄。 
home  :Points the browser to the URL specified in preferences as the user's home page. 
moveBy   : Moves the window by the specified amounts.  移动窗口
moveTo  :Moves the top-left corner of the window to the specified screen coordinates.  移动窗口以左上角为基准到指定的坐标
open  :Opens a new web browser window.   打开一个新窗口
print  :Prints the contents of the window or frame.   打印内容
prompt  :Displays a Prompt dialog box with a message and an input field.   显示一个提示对话窗并可以输入信息
releaseEvents  :Sets the window to release captured events of the specified type, sending the event to objects further along the event hierarchy.
resizeBy  :Resizes an entire window by moving the window's bottom-right corner by the specified amount.   改变窗口的大小
resizeTo  :Resizes an entire window to the specified outer height and width.   
改变窗口的大小(长宽)
routeEvent  :Passes a captured event along the normal event hierarchy. 
scroll  :Scrolls a window to a specified coordinate.  滚动窗口到一个指定的坐标
scrollBy  :Scrolls the viewing area of a window by the specified amount.
scrollTo  :Scrolls the viewing area of the window to the specified coordinates, such that the specified point becomes the top-left corner.   滚动窗口到指定的高度
setInterval  :Evaluates an expression or calls a function every time a specified number of milliseconds elapses.
setTimeout  :Evaluates an expression or calls a function once after a specified number of milliseconds has elapsed. 
stop



原创粉丝点击