Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery Syntax #42

Closed
craigerskine opened this issue Sep 8, 2016 · 3 comments
Closed

jQuery Syntax #42

craigerskine opened this issue Sep 8, 2016 · 3 comments
Labels

Comments

@craigerskine
Copy link

None of the examples on this page work:
https://sachinchoolur.github.io/lightgallery.js/demos/html-markup.html

I'm assuming it's because they are using jQuery syntax which does not work. Is there a way to get this gallery to work with targeting a class instead of an ID? It would be nice if there was a way to use jQuery syntax since it's so convenient.

@krestaino
Copy link

krestaino commented Oct 4, 2016

Yeah this was annoying me too. This is how I worked around it. They still need a unique ID unfortunately.

$(document).ready(function(){
  var galleries = ["gallery1","gallery2","gallery3","gallery4","gallery5","gallery6"];
  var galleriesLength = galleries.length;

  for (var i = 0; i < galleriesLength; i++) {
    lightGallery(document.getElementById(galleries[i]), {
      download: false,
      subHtmlSelectorRelative: true,
      thumbnail: true
    });
  }
});

@adm1t
Copy link
Contributor

adm1t commented Sep 4, 2019

lol. this problem is still relevant

@stale
Copy link

stale bot commented May 16, 2021

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.

@stale stale bot added the v1 label May 16, 2021
@stale stale bot closed this as completed May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants