-
Notifications
You must be signed in to change notification settings - Fork 168
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
Possible to Create Multiple Galleries on a Single Page? #84
Comments
Yes it's possible, as you can see here : https://github.com/nicolas-t/Chocolat/blob/master/dist/index.html |
Closing due to lack of activity. |
What about multiple sets for generated galleries?
|
Hello, Not sure I understood your request correctly. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="../dist/css/chocolat.css" />
<script type="text/javascript" src="../dist/js/chocolat.js"></script>
<title>Chocolat — demo</title>
</head>
<body>
<div class="images">
<a class="imagelink" href="demo-images/1.jpg">1</a>
<a class="imagelink" href="demo-images/2.jpg">2</a>
</div>
<div class="images">
<a class="imagelink" href="demo-images/3.jpg">3</a>
<a class="imagelink" href="demo-images/4.jpg">4</a>
</div>
<div class="images">
<a class="imagelink" href="demo-images/5.jpg">5</a>
<a class="imagelink" href="demo-images/6.jpg">6</a>
</div>
<script>
const set = document.querySelectorAll('.images')
for (let i = 0; i < set.length; i++) {
const gallery = set[i].querySelectorAll('.imagelink')
Chocolat(gallery)
}
</script>
</body>
</html> |
Thank you, when I try that I have a set overlap, the issue must be in my code. I will come back if the issue remains, but I am sure it is my mistake. Thank you for your time. |
I just found my mistake. My HTML structure looks like that:
And I figured out that selecting Sidenote, it would be nice to have the for loop trick as an example for multiple galleries on the documentation, for beginners working with generated images lists (e.g. CMS). |
Hi, I am curious if there is a way to create galleries of the same type on a single page. For example, three #example3 / #container2 galleries within a single page of html. Thanks so much!
The text was updated successfully, but these errors were encountered: