21st Jul '22
/
11 comments

Button to Open Bricks Gallery

Button to Open Bricks Gallery

Updated on 5 Apr 2024

This Pro tutorial provides the steps to trigger a click on the first image of a gallery in Bricks when a button is clicked.

We are going to set a fixed height for the gallery with overflow: hidden so that only a few images will be shown and the user can either click on any of the images or on the "View All Photos" button and browse all of them in the lightbox.

Step 1

Edit your Template/Page with Bricks.

Add a Section.

Set Section's Container's position to relative.

Add a Image Gallery element inside the Section's container.

Select/upload your desired images or if you have a ACF Gallery field or Meta Box Advanced Image field set up, select it as the source of images.

Link to: Lightbox.

STYLE → LAYOUT: Set a Max. height (534px in my test site).

Overflow: hidden

Step 2

Add a Button element below the Image Gallery.

Position: AbsoluteRight: 10pxBottom: 10px

Step 3

Click on the Settings (gear) icon → PAGE SETTINGS → CUSTOM CODE and paste the following under Body (footer) scripts:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 633 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Dynamic HappyFiles Gallery in Bricks with Meta Box or ACF Pro

Dynamic HappyFiles Gallery in Bricks with Meta Box or ACF Pro

Updated on 12 Jul 2023 This Pro tutorial provides the steps to show the images uploaded to an "Image Advanced" type of custom field created…
Categories:
Pro
Configuring Image Gallery dynamic source in Bricks

Configuring Image Gallery dynamic source in Bricks

Let's say you have a custom field created with ACF Pro of the type Gallery called "Property Gallery" for posts of "Property" CPT. In the…
Pro
Meta Box/ACF Images Staggered Grid Gallery in Bricks

Meta Box/ACF Images Staggered Grid Gallery in Bricks

Showing images from two Gallery-type of ACF or Image Advanced-type of Meta Box fields in a staggered grid layout.
How to create filters with IsotopeJS in Bricks (Part 2): Dynamic Image Galleries

How to create filters with IsotopeJS in Bricks (Part 2): Dynamic Image Galleries

This tutorial series will review how to create a dynamic filterable image gallery using the IsotopeJS library‘s features in Bricks. Requirements Create a custom taxonomy for your…