scroll-in-modal

1.0.1 • Public • Published

说明

在开发 H5 页面弹窗时,默认在滑动弹窗,底下的 body 也会滚动。这种情况,只要把包括弹窗的父元素禁用 touchmove 事件即可。 但假如弹窗里也有内容需要滚动,禁用父元素的 touchmove 事件会导致弹窗内的内容也无法滚动。 scroll-in-modal 就是解决 H5 端下弹窗内部滚动,不影响 body 滚动。

使用

import scrollInModal from 'scrollInModal';
const containerDom = document.getElementById('container');
const scrollDom = documentt.getElementById('scroll-content');

scrollInModal(containerDom, scrollDom);

Readme

Keywords

Package Sidebar

Install

npm i scroll-in-modal

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

3.05 kB

Total Files

4

Last publish

Collaborators

  • seven_7