Home › Forums › JavaScript › Setting (max) widths on certain/specified Fancybox overlays. › Reply To: Setting (max) widths on certain/specified Fancybox overlays.
October 31, 2016 at 6:52 am
#247222
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';
}
}