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.

#247222
grimski
Participant

Although it seems to work, I get an error with that code.

if ($(this.element).hasClass('fancybox--small')) this.maxWidth = '640';

I get an error “Expected ‘{‘ and instead saw ‘this’.” – does it just need to brackets around the bit we’re changing? Like…

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