disable-body-scroll

Disable the scrolling of the content of the body when the content of the pop-up window is scrolled
5,159
Install
npm install disable-body-scroll
Latest Version:0.1.8
Vue:2
License:MIT
Last Updated:Feb 9, 2022
Links: GitHub  ·  npm
Maintainer: lucy2

disable-body-scroll

  • Disable the scrolling of the content of the body when the content of the pop-up window is scrolled
  • Please add to the Y-axis scrolling element
  • Support vue directive(vue2,vue3)
  • Support independent function call
  • demo

Project setup

npm install disable-body-scroll

export

key desc params1 params2
disabledBodyScroll disabledBodyScroll function scroll dom ---
directive vue directive config -- ---

Usage

disabledBodyScroll
  • recommended to replace it with directive if you use vue
disabledBodyScroll(document.querySeletor("#modelScrollBox"));
directive
  • only work with vue
import { directive } from "disable-body-scroll";
Vue.directive("disabled-body-scroll", { ...directive });
//
<div id="modelScrollBox" v-disabled-body-scroll>
  ...
</div>
;
Q&A
  • Dynamically enable or disable the diasabledScroll

  • like v-disabled-body-scroll:[disabledScrollDirectiveStatus],variable disabledScrollDirectiveStatus is ”working“ or "disabled"

  • Adaptive horizontal screen app

  • like v-disabled-body-scroll="rotate",Variable rotate equals 0 or 90 or - 90

Related Packages

vue-disable-autocomplete

Disable autocomplete on input elements

31,695
@aacassandra/vue-disable-autocomplete

Disable autocomplete on input elements

7,140 6
@nylira/vue-article-body

Article body component for Vue 2.

5,633 0
vue-turn-off-autocomplete

Plugin to fix browser`s disable autocomplete issue.

3,647
vue-body-class

Control you body classes easily with vue-router

29,903 40

Version History

Version Released Vue License
0.1.8 ^2.6.11 MIT
0.1.7 ^2.6.11 MIT
0.1.6 MIT
0.1.5 ^2.6.11 MIT
0.1.4 ^2.6.11 MIT