Update thumbnails.js

This commit is contained in:
A-Circle Zhang 2018-08-23 23:10:53 +08:00 committed by GitHub
parent bb0fb95c3c
commit 474eb0e719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class Thumbnails {
move (position) {
this.container.style.backgroundPosition = `-${(Math.ceil(position / this.barWidth * 100) - 1) * 160}px 0`;
this.container.style.left = `${(position - this.container.offsetWidth / 2)}px`;
this.container.style.left = `${Math.min(Math.max(position - this.container.offsetWidth / 2, -10), this.barWidth - 150)}px`;
}
hide () {
@ -29,4 +29,4 @@ class Thumbnails {
}
}
export default Thumbnails;
export default Thumbnails;