Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Setting (max) widths on certain/specified Fancybox overlays. Reply To: Setting (max) widths on certain/specified Fancybox overlays.

#247295
grimski
Participant

Thanks a lot! Likely other pieces of code I’ve cobbled together though which didn’t quite work …which is why I post it here haha!

I ended up using

beforeLoad: function() {
    if ($(this.element).hasClass('fancybox--small')) {
        this.maxWidth = 600;
    }
}

Seems to do the job. It’s not something I’ve ever needed and I’ve used the plug-in for years. Very much a fringe case. So, as long as that maxWidth works as it is, it’ll certainly do! Going to do some further browser testing now though :)