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

Question/Suggestion: Span gallery over more then one div #239

Open
flyinggecko opened this issue Jul 13, 2020 · 1 comment
Open

Question/Suggestion: Span gallery over more then one div #239

flyinggecko opened this issue Jul 13, 2020 · 1 comment

Comments

@flyinggecko
Copy link

Hey,

Is it possible to do something like this:

<div class="gallery"
   <a>
    <img />
  </a>
</div>
<other stuff>
<div class="gallery"
...
</div>

The idea is to have some of those divs on a page and when you open the gallery, all image are available there.

Best regards

@ajeetgill
Copy link

ajeetgill commented Sep 2, 2021

Hey,

Is it possible to do something like this:

<div class="gallery"
   <a>
    <img />
  </a>
</div>
<other stuff>
<div class="gallery"
...
</div>

The idea is to have some of those divs on a page and when you open the gallery, all image are available there.

Best regards

I think the when you run
baguetteBox.run('.baguetteBoxOne');

It's run on that container, that is, it works on all the tags in the format

    <a>
        <img />
    </a>

That is, if you have something like

<div class="baguetteBoxOne">
<something else.... /> 
    <a>
        <img />
    </a>
    <a>
        <img />
    </a>
    <a>
        <img />
    </a>
<something else.... /> 
    <a>
        <img />
    </a>
<something else.... /> 
    <a>
        <img />
    </a>
    <a>
        <img />
    </a>
    <a>
        <img />
    </a>
</div>

It'll show all those, irrespective of where in the DOM they're.

<a>
   <img />
</a>

images, coz they're all in the same .baguetteBoxOne container.

Long story short, you can wrap all your image elements in a single container and run baugettebox on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants