sachinchoolur / lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
https://sachinchoolur.github.io/lightgallery.js/
Other
5.3k stars 596 forks source link

destroy function scrolls the page up #78

Closed adirkandel closed 3 years ago

adirkandel commented 6 years ago

When i destroy the gallery it gets to these 2 lines: document.body.scrollTop = _this.prevScrollTop; document.documentElement.scrollTop = _this.prevScrollTop;

but _this.prevScrollTop is undefined the window scrolls to 0, means the top of the scroll position.

alexrififi commented 6 years ago

Same problem. Strange ... Why move the scroll when destroying?

parisek commented 5 years ago

Its fixed in sibling plugin https://github.com/sachinchoolur/lightGallery/blob/master/dist/js/lightgallery.js#L1285 so I just comment out this lines and it works

@sachinchoolur Could you please fix it also here? Thank you

piernik commented 3 years ago

I have the same issue. I need to destroy lightgallery to refresh images. As I can see now it is the only way.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions.