当前位置:网站首页>JS window object
JS window object
2022-06-09 08:46:00 【Calf (ox)】
One 、screen attribute
window.screen Object contains information about the user screen
screen.availWidth Screen width
screen.availHeight Screen height
Two 、history object
forward() Method to load the next page in the history list
back() Method to load the previous page in the history list ( If there is )
go( Parameters ) Method to load a specific page in the history list
Parameters can be numbers , Use the page you want to visit in History Relative position in the page list of .
go(0) Refresh this page
go(1) Go to a page
go(-1) Go back to the previous page
3、 ... and 、location object
location.href Return the address of the current page
location.pathname Pathname
location.reload() Reload Refresh this page
3、 ... and 、 navigator
window.navigator Object contains information about the visitor's browser .
Four 、open()
Open a new browser window , Load given URL Specified document
window.open(
"http://www.baidu.com",
"_blank",
"width=500,height=500"
);// Open a new window , Width 200px, Height 500px
window.close(); // close
5、 ... and 、 event
window.onload = function () {};
wait until html Document loaded ( Including pictures, etc. after downloading ) after , Will trigger onload eventwindow.onresize = function () {
console.log(" The window size has changed ");
};
When the window size changes , Will trigger onresize eventwindow.onscroll = function () {
console.log(" Your browser scroll bar scrolled ");
};
When the scroll bar scrolls, it triggers onscroll event
6、 ... and 、 Back to the top
var _gotop = document.getElementById("gotop");
var timer = null,
sTop;
_gotop.onclick = function () {
timer = setInterval(function () {
document.documentElement.scrollTop -= 10;
sTop = document.documentElement.scrollTop;
if (sTop <= 0) {
clearInterval(timer);
}
// console.log(sTop);
}, 100);
};边栏推荐
- Is it safe for flush to open an account? Is it reliable?
- 85. (leaflet house) leaflet military plotting - line arrow drawing
- 工业企业能源管控系统帮助企业加强能源管理、提高设备运行效率
- SQL: 股票的资本损益
- 配置RMAN备份的环境_配置高级的备份选项
- Sql: find duplicate email addresses
- Use Flashback Database and restore point
- Sql: Sales Analysis III
- SSM实现选中删除
- 框架初入门:更新表达式无效 ,必须至少更新一列
猜你喜欢

How to view websites or apps bound to mobile phones: what you must do before you log off your mobile phone number - change and bind all websites or apps bound to your old mobile phone number

清洗数据---2022/06/08

shellcode编写

安装mysql保姆级教程

编辑器说明-备用

安科瑞配电室综合监控系统实现配电室内环境的在线监测,保障配电室设备的安全运行

Install MySQL nanny tutorial

【TeXstudio】【2】一般的图片和表格的表现形式

模拟面试策划书;校园模拟面试策划书;求职模拟面试大赛策划书;经管学院模拟求职大赛策划书;大学生模拟面试大赛策划书

Modify campaign table
随机推荐
Editor description - alternate
RMAN backup concept_ About RMAN incremental backup
【程序人生】互联网岗位分工;互联网开发流程;职责分工
Configuring the environment for RMAN backups_ Configure backup retention policy
RMAN备份概念_关于RMAN控制文件和服务器参数文件的自动备份
Oracle locally managed tablespaces
Mobile terminal layout of Xiaomi official website
English语法_时间副词
Sql: Sales Analysis III
RMAN备份概念_关于RMAN备份的多个拷贝
配置Conda环境和Pytorch安装
shellcode编写
安科瑞Acrel-BUS智能照明控制系统在医院的应用
使用闪回数据库(FLASHBACK DATABASE)和还原点(RESTORE POINT)
小米官网移动端布局
RMAN backup concept_ About image copy
Self made compiler learning 4: using flex
业务判断逻辑代码 if 语句
編輯器說明-備用
SQL: Championship winner