window方法:scrollByPages()

2018-09-20 14:06 更新

scrollByPages()方法

注意:此功能是非標(biāo)準(zhǔn)的,不要在面向Web的生產(chǎn)站點上使用它,它不適用于每個用戶。實現(xiàn)之間可能存在很大的不兼容性,并且行為可能在將來發(fā)生變化。

scrollByPages()方法按指定的頁數(shù)滾動當(dāng)前文檔。

scrollByPages()方法語法

window.scrollByPages(pages)

參數(shù)

  • pages是要滾動的頁數(shù),可以是正整數(shù)或負整數(shù)。

示例

// scroll down the document by 1 page 
window.scrollByPages(1);

// scroll up the document by 1 page 
window.scrollByPages(-1);

規(guī)范

DOM級別0.不屬于規(guī)范。

瀏覽器兼容性

電腦端 移動端
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
Android webview Chrome for Android
Edge Mobile Firefox for Android
Opera for Android
iOS Safari
基本支持
(非標(biāo)準(zhǔn))
不支持 支持 ? ? 不支持 不支持 不支持 ? 不支持 ? 不支持
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號