As designed Lightbox not triggered when images are smaller than the message area

Affected version
2.2

Timmie

Active member
I've noticed that the new lightbox with 2.2 is not being triggered when full-size images are inserted that have a smaller width than the message area.

There are two downsides here:

1. If the lightbox is being used to scroll through all images on a page then the smaller images will not be picked up by the lightbox.

2. If attachment mirroring is setup and you want to make use of the lightbox sidebar to like and comment on individual images this won't be possible.

Maybe there a setting that can be changed to trigger the lightbox even when the images are smaller than the message area?
 

Chris D

XenForo developer
Staff member
This is intentional and has roughly always been this way. If the image is already displayed full width inside the message then opening it up in the lightbox has little benefit.

It could also be unexpected in some cases. For example if someone hotlinks or attaches a very small image, like a small reaction GIF or a custom smiley or something similar then this being displayed in the lightbox is probably not desirable.

There's no plans for any changes here at the moment but you may want to open a suggestion if one doesn't already exist.
 

Timmie

Active member
Thanks Chris. The benefits here are being able to use the lightbox to "view all" images on the page even those with a smaller width than the message area, and of course being able to use the interactions such as liking and commenting on individual images when mirrored. I'll check for suggestions and open one if I can't find anything similar.
 

Mr Lucky

Well-known member
The benefits here are being able to use the lightbox to "view all" images on the page even those with a smaller width than the message area,
I get the point of this even though I don't, and cannot think of a reason to, use it myself. Maybe a photo contest?

But how would you deal with things like this? old.gif
 

Chris D

XenForo developer
Staff member
There would be no way to deal with things like that other than simply displaying them in the lightbox, and making it so the lightbox would trigger if it was clicked.
 

Timmie

Active member
I get the point of this even though I don't, and cannot think of a reason to, use it myself. Maybe a photo contest?
If someone uses the lightbox to scroll thought images on a page then they might miss those that are not triggering the lightbox.

Also if you have attachment mirroring setup you can now make use of the lightbox with the sidebar for image interactions and viewing metadata, but this will not be available to any image attachments (inserted as a full-size) that are smaller than the message area and thus not triggering the lightbox.

I run a photography forum and users would like to be able to comment and like individual images in the forums as opposed to just liking the post itself, or saying something like: "I really like the 3rd, 7th and 9th image". Attachment mirroring enables this possibility which is fantastic but with the smaller images not triggering the lightbox it's not consistent.
 

Mr Lucky

Well-known member
There would be no way to deal with things like that other than simply displaying them in the lightbox, and making it so the lightbox would trigger if it was clicked.
Exactly my point, hence what you said above makes total sense. ie attached or hotlinked smilies make no sense in a loghbox.
 

Timmie

Active member
Exactly my point, hence what you said above makes total sense. ie attached or hotlinked smilies make no sense in a loghbox.
Maybe only triggering the lightbox for images over 50px or 100px in width would avoid smilies being displayed in the lightbox but catch 99% of other images.
 

spirogg

Active member
Maybe only triggering the lightbox for images over 50px or 100px in width would avoid smilies being displayed in the lightbox but catch 99% of other images.
Maybe add an option in the media addon in ACP for admins to set the px size for triggering the lightbox. Then admins can use whatever they decide. That would be the best option here IMO. And I’m sure not hard to do. Keep the standard px size in settings and we can adjust whatever px we need for our own taste.
 
Last edited:
Top