Skip to content

Commit

Permalink
Remove image slide animation.
Browse files Browse the repository at this point in the history
  • Loading branch information
cweijan committed Mar 4, 2024
1 parent f0c7ce4 commit d5c9ece
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions resource/lightgallery/js/lightgallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
*/
Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) {

var _prevIndex = this.$outer.find('.lg-current').index();
var _prevIndex = this.$outer.find('.lg-current').index();
var _this = this;

// Prevent if multiple call
Expand Down Expand Up @@ -1236,29 +1236,29 @@
this.$slide.eq(_touchNext).addClass('lg-next-slide');
};

let slideTime;
Plugin.prototype.mousewheel = function() {
var _this = this;
_this.$outer.on('mousewheel.lg', function(e) {
_this.$outer.on('mousewheel.lg', function(e) {});
window.addEventListener('wheel',(e)=>{
if (!e.deltaY) {
return;
}
if(isCompose(e)){
if (e.deltaY > 0) _this.callScale(_this.s.scale)
else _this.callScale(-_this.s.scale)
return;
}

const curTime=new Date().getTime();
if(curTime-slideTime<800) return;
slideTime=curTime;
if (e.deltaY > 0) {
if(isCompose(e)){
_this.callScale(_this.s.scale)
}else{
_this.goToPrevSlide();
}
_this.goToPrevSlide();
} else {
if(isCompose(e)){
_this.callScale(-_this.s.scale)
}else{
_this.goToNextSlide();
}
_this.goToNextSlide();
}

e.preventDefault();
});
})

};

Expand Down
2 changes: 1 addition & 1 deletion resource/lightgallery/lg.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
lg.lightGallery({
download: false,
closable: false,
speed: 450,
speed: 0,
controls: false,
escKey: false,
supportLegacyBrowser: false,
Expand Down

0 comments on commit d5c9ece

Please sign in to comment.