sachinchoolur / lightGallery

A customizable, modular, responsive, lightbox gallery plugin.

Home Page:https://www.lightgalleryjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passive listeners for better scrolling performance

darkkatarsis opened this issue · comments

Summary

Hi, Is it possible for a script that listens for a scroll event to run in passive mode? Tests in page speed each time suggest that the current solution is not the best and blocks rendering of the page.

Screenshot 2022-04-21 at 15 11 26

Basic example

document.addEventListener('touchstart', onTouchStart, {passive: true});
https://web.dev/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=lr

Motivation

  • Better performance
  • Better indexing of pages by google

Closing as duplicate - #1243

Thank you for reporting this.