Skip to content

Keyboard navigation with arrows malfunctioning when Lightbox initialized multiple times #702

Open
@MichalRemis

Description

When lightbox is initialized multiple times (e.g. when Ajax content is loaded and lightbox needs to be reenabled), Lightbox keyboard navigation doesn't work properly - arrow keys are skipping multiple images, not just one. It's because keyboard listeners are bound multiple times when opening lightbox.

Example:

  1. go to https://lokeshdhakar.com/projects/lightbox2/ ,
  2. open console and type lightbox.init()
  3. click on FOUR IMAGE SET lightbox and try to navigate with arrows

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions