()
| 265 | |
| 266 | //获取窗口大小. |
| 267 | function getWindowSize() { |
| 268 | /* |
| 269 | //包含滚动条 |
| 270 | return { |
| 271 | h:window.innerHeight, |
| 272 | w:window.innerWidth, |
| 273 | }; |
| 274 | */ |
| 275 | |
| 276 | //去除滚动条的窗口大小 |
| 277 | var de = document.documentElement; |
| 278 | var body = document.body; |
| 279 | var backCompat = document.compatMode == 'BackCompat'; |
| 280 | return { |
| 281 | height: backCompat? body.clientHeight : de.clientHeight, |
| 282 | width: backCompat? body.clientWidth : de.clientWidth, |
| 283 | }; |
| 284 | |
| 285 | }; |
| 286 | |
| 287 | //获取已滚动的距离 |
| 288 | function getScrolled(container) { |
no outgoing calls
no test coverage detected