js BOM操作:
浏览器对象模型,提供了独立于内容,而与浏览器窗口进行交互的对象,描述了与浏览器进行交互的方法与接口,可以对浏览器窗口进行访问操作。
(1)window对象
alert() 弹出框
confirm() 带确认,取消弹出框
setInterval() 每隔多少秒调用一次
clearInterval() 清除setInterval
setTimeout() 隔多少秒调用一次
cleartimeout() 清除setTimeout
open() 打开一个新的窗口
(2)子对象:
location;history;document;screen;
document对象
1、每个载入浏览器的HTML文档都会成为document的对象。
2、可以访问HTML的所有元素
history:历史浏览位置
location跳转位置
screen屏幕
screen.availHeight屏幕的内容高
screen.height屏幕的整个高
screen.width=screen.availWidh;屏幕的内容宽=屏幕的整个宽
可视区域的宽和高
document.documentElement.clientHeight;
document.body.clientHeight;内容的
document.documentElement.clientWidth;
document.body.clientWidth;内容的
window.innerWidth;
window.innerHeight;