open(url,打開方式)
新窗口打開空白頁
//open(地址默認是空白頁面护蝶,打開方式默認新窗口) 打開一個新窗口
//window.open('http://www.baidu.com', '_self');
opener = window.open();//返回值 返回的新開頁面的window對象
//alert(opener == window)
//opener.document.body.style.background = 'red';
close()
ff : 無法關閉
chrome : 直接關閉
ie : 詢問用戶
opener.close(); //可以通過關閉用window.open方法打開的窗口
//window.navigator.userAgent : 瀏覽器信息
/window.location : 地址
/*
window.location.href = window.location內(nèi)容
window.location.search = url?后面的內(nèi)容
window.location.hash = url#后面的內(nèi)容
*/
//alert( window.location );
//alert( window.location.href );//地址
//alert( window.location.search );
//alert( window.location.hash );
窗口尺寸大小
可視區(qū)尺寸
document.documentElement.clientWidth
滾動條滾動距離
document.documentElement.scrollTop
document.body.scrollTop//chrome
scrollTop=document.documentElement.scrollTop||document.body.scrollTop
可視區(qū)尺寸
document.documentElement.clientWidth
document.documentElement.clientHeight
滾動距離
document.body.scrollTop/scrollLeft
document.documentElement.scrollTop/scrollLeft
內(nèi)容高度
document.body.scrollHeight
文檔高度
document.documentElement.offsetHeight
document.body.offsetHeight
onscroll:當滾動條滾動的時候觸發(fā) 時間間隔
onresize:窗口大小改變觸發(fā)