原生控制器
self.webView.addObserver(self, forKeyPath: "scrollView.contentSize", options: NSKeyValueObservingOptions.new, context: nil)
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
print("監(jiān)聽網(wǎng)頁滾動")
}
web頁面
js監(jiān)聽滾動位置