Image Addon: How to make whole image clickable ---> Lightbox - Forum | JoomShaper
Solved SP Page Builder

Image Addon: How to make whole image clickable ---> Lightbox

Asked by Ernst Frank 5 years ago Last activity 4 years ago

Hey,
I want to make the image clickable as a whole. In the moment you have to click the magnifying glass to open the lightbox. I want that you can click anywhere in the image to open it. Can somebody give me a hint or the solution for this problem?

Another thing would be to change the magnifying glass to another icon.

Website: http://hwc.hosting138274.a2e55.netcup.net/index.php/component/sppagebuilder/?view=form&layout=edit&tmpl=component&id=5&Itemid=0

Thank you

Accepted answer

Marked as the solution
Pavel

Not need customize site.php. Enough custom css code.
Set image overlay as transparent.
Add this class in image addon whole-image-clickable.
Add this code in template custom.css file.

.whole-image-clickable .sppb-addon-image-overlay-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    font-size: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.3);
}

To add font awesome icon use this code

.whole-image-clickable .sppb-addon-image-overlay-icon::before {
    content: "\f00e";
    position: absolute;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 50px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
}

It will looks like this

2 more replies

Ofi Khan Staff

Hello Ernst Frank

You need to customize the addon. Please go to this location: components\com_sppagebuilder\addons\image and customize site.php file.

Best regards

Ernst Frank Asked this

Hey... sorry for the late reply.... I found a other solution back then but needed it for the new project. Pavels solution is good THX

Log in to reply.