Autostart feature breaks when script is combined
I'm using the Rails asset pipeline to combine all my scripts into a single file. This breaks fancybox completely because of this:
if ($("script[src*='jquery.fancybox.js']").attr('src').match(/autorun/) ){
The attr call returns undefined, so this throws.
Yes, I also am experiencing this error, commenting it out solves it for me. Would love to see some resolution to this issue.
Agreed. I am not sure how to fix this? Are you suggesting commenting the entire if block?
/* if ($("script[src*='jquery.fancybox.js']").attr('src').match(/autorun/) ){ $("a[href$='.jpg'],a[href$='.png'],a[href$='.gif'],.fancybox").attr('data-fancybox-group', 'gallery').fancybox(); } */
This would at least keep it from breaking everything without removing the feature.
var src = $("script[src*='jquery.fancybox.js']").attr('src')
if src && src.match(/autorun/) ){
...
}
The autostart feature still wouldn't work if it was combined, but I'm ok with that.
Hi, please, upgrade to v3.