一、Windows操作對象
1、窗口操作:
moveBy(dx,dy)把瀏覽器窗口相對位置水平移動dx像素,垂直移動dy個像素。dx為負數(shù) 向左移動,dy為負向上移動
moveTo(x,y)移動到位于左上角跑那個木的x,y處(負數(shù))
resizeBy(dw,dh)擴大當前窗口的寬+dw 個像素 高+dh個像素 (負數(shù))
resizeTo(w,h)把寬高調整到w,h (不能使用負數(shù))
2、導航和打開新窗口:
windows.open("
windows.open("地址","wroxwindow","height=150,width=300,top=10,left=10,resizable=yes") 第三個參數(shù)定義新窗口屬性。 var newWin=window.open() newWin.moveTo() 3、系統(tǒng)對話框 1.alert()用與輸入數(shù)據無效時 2.confirm() 顯示 OK Cancel按鈕 if(confirm("Are you sure?")){ alert("sure"); }else{ alert("not sure"); } 3.prompt()顯示給用戶輸入的對話框 var Result= prompt("What's your name ?","Michael";) if(result!=null){} 4、狀態(tài)欄。 window.defaultStatus="dddd"; 當鼠標移動到某個連接上時顯示該連接的信息: <a href="xx.html" onmouseover="window.status='information on wros books.' ">book</a> 5、時間間隔和暫停window對象的setTimeout方法 setTimeout(執(zhí)行的代碼, 暫停的毫秒數(shù)) var time= serTimeout(function(){alert();},1000); clearTimeout(time); setInterval("代碼",1000)代碼每次執(zhí)行之間等待的毫秒數(shù) 6、歷史 go()前進或后退的頁面數(shù) window.history.go(-1) 后退一頁 <a href="javascript:history.go(-1)">back</a> history.back(); history.forward()可以實現(xiàn)同樣的操作。 7、location location.href="網址"; location.reload(true);從服務器端重載當前頁面 location.reload(false);或者location.reload();從緩存重載當前頁面 location.toString()返回location.href的值。 8、screen對象 screen.availHeight 窗口可以使用的屏幕的高度像素 screen.availWidth 窗口可以使用的屏幕的寬度像素 heigth、with屏幕的高度、寬度
減肥瘦身品總匯
值得信賴*脈脈美妝*正品現(xiàn)貨謝絕講價
〓深港商盟〓名品歐衣坊(美國休閑品牌AF系列)
QQ三國游戲幣及道具專賣店
小臉紅紅的瘦身旗艦店