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

Adding a visible={visible} prop such as react-viewer have for displaying the carousel and closing it. #1663

Open
virusxd521 opened this issue Sep 16, 2024 · 1 comment
Labels

Comments

@virusxd521
Copy link

Summary

Adding a visible={visible} prop such as react-viewer have for displaying the carousel and closing it.

Basic example


          const [visible, setVisible] = useState(false);

          <LightGallery plugins={[lgZoom, lgVideo]} mode="lg-fade" visible={visible} 
          onClose={() => {
            setVisible(false);
          }}>
            <a
              data-lg-size="1406-1390"
              className="gallery-item"
              data-src="https://images.unsplash.com/photo-1581894158358-5ecd2c518883?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1406&q=80"
              data-sub-html="<h4>Photo by - <a href='https://unsplash.com/@entrycube' >Diego Guzmán </a></h4> <p> Location - <a href='https://unsplash.com/s/photos/fushimi-inari-taisha-shrine-senbontorii%2C-68%E7%95%AA%E5%9C%B0-fukakusa-yabunouchicho%2C-fushimi-ward%2C-kyoto%2C-japan'>Fushimi Ward, Kyoto, Japan</a></p>"
            >
              <img
                className="img-responsive"
                src="https://images.unsplash.com/photo-1581894158358-5ecd2c518883?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=240&q=80"
              />
            </a>
          </LightGallery>

Motivation

I would like to be able to open and close the carousel when clicking a button such as 'Show carousel' meanwhile hiding the grid while the carousel is close.

Copy link

stale bot commented Nov 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the v1 label Nov 16, 2024
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

1 participant