Skip to content

Commit f90e8df

Browse files
authored
Merge pull request #6 from pexea12/no-scroll
feat: disable scroll when open lightbox
2 parents 0fd70f1 + d754579 commit f90e8df

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/script.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,17 @@ export default {
119119
this.$set(this, 'beginThumbIndex', this.select - halfDown + mod)
120120
this.$set(this, 'thumbSelect', halfDown - mod)
121121
this.$set(this, 'displayThumbs', this.images.slice(this.select - halfDown + mod, this.select + halfDown + 1))
122-
}
122+
},
123+
124+
lightBoxOn(value) {
125+
if (document != null) {
126+
if (value) {
127+
document.getElementsByTagName('body')[0].classList.add('vue-lb-open')
128+
} else {
129+
document.getElementsByTagName('body')[0].classList.remove('vue-lb-open')
130+
}
131+
}
132+
},
123133
},
124134

125135
methods: {

src/components/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,7 @@ img.vue-lb-modal-image {
232232
}
233233
}
234234

235+
.vue-lb-open {
236+
overflow: hidden;
237+
}
238+

0 commit comments

Comments
 (0)