当前位置:网站首页>BOM部分属性及理解
BOM部分属性及理解
2022-07-28 10:29:00 【差不少】
BOM部分属性及理解
BOM称之为浏览器对象模型。里面主要是我们和浏览器进行交互的方法。
是由IE3.0和Netscape Navigator3.0(网景)提供的一种新的特性,主要是用来通过JS这门脚本语言来操作浏览器,方便我们对浏览器窗口进行访问。
BOM中包含的一些对象:
Window对象
Navigator对象
Screen对象
History对象
Location对象
window(窗口),表四浏览器窗口,顶层对象,所有全局变量都属于window
window.name 当前浏览器的名字(可存几兆的内容)
window.closed 已关闭的窗口
window.opener 打开的窗口对象
注:
window.opener在当前窗口为当前窗口对象,在子窗口里指的是该子窗口的父窗口
可使用window.opener.document.write( )等操作
window.open( )打开一个新窗口的方法
注:
为了安全性考虑,子窗口与父窗口是可以传输数据的,如果新开的窗口与父窗口没有通信的必要,将opener设为null。
写法:
var a=window.open();
a.opener=null;
属性:
window.screenX,window.screenY
当前浏览器窗口左上角相对于当前屏幕左上角的水平距离和垂直距离,单位是像素,并且属性为只读
window.innerWidth,window.innerHeight
当前网页在当前窗口中可见部分的宽度和高度。也就是俗称的视口"viewport"。
可见部分:
可现实内容部分。如果窗口被遮住一半,那另一半就是可见部分,就只有一半的高度。
window.outerWidth,window.outerHeight
浏览器窗口的宽度和高度
window.scrollX,window.scrollY
页面滚动的横向距离和纵向距离
边栏推荐
- 20200229 training match L1 - 2 delete the substring in the string (20 points)
- 机器人技术(RoboCup 2D)如何进行一场球赛
- Blue Bridge Cup embedded Hal library LCD
- [application of stack] - infix expression to suffix expression
- GKPerlinNoiseSource
- GKSphereObstacle
- Samba learning
- Blue Bridge Cup embedded Hal library systick
- GKNoiseSource
- Machine learning -- handwritten English alphabet 3 -- engineering features
猜你喜欢

ACM winter vacation training 6

GKSpheresNoiseSource

Blue Bridge Cup embedded Hal library systick

SQL Server 2016 learning record - nested query

ICML 2022 | 图表示学习的结构感知Transformer模型

GKRidgedNoiseSource

7、MapReduce自定义排序实现

AP AUTOSAR platform design 3 architecture

Attention attention mechanism flow chart

Semeval 2022 | introducing knowledge into ner system, aridamo academy won the best paper award
随机推荐
5、Window端实现Mapreduce程序完成wordcount功能
11_ UE4 advanced_ Change male characters to female characters and modify the animation
产品端数据分析思维
An example of SQL trace in MySQL
11_ue4进阶_男性角色换成女性角色,并修改动画
QT generation Exe file and run without QT environment (enigma virtual box for green executable software packaging) graphic tutorial
Markdown to word or PDF
SDUT 2446 final ranking
Install Office customization. Troubleshooting during installation
ICML 2022 | graph represents the structure aware transformer model of learning
clo*******e:项目管理随记
爱可可AI前沿推介(7.28)
蓝桥杯嵌入式-HAL库-ADC
从零开始Blazor Server(2)--整合数据库
Solving the optimal solution of particle swarm optimization
[application of stack] - infix expression to suffix expression
GKLinearCongruentialRandomSource
GKCylindersNoiseSource
GKARC4RandomSource
Configuring raspberry pie, process and problems encountered