fotorama: can't get the API object (undefined)
问题 I'm using Fotorama 4.5.0 (Rails gem) and I have a problem with getting the API object. On page load Fotorama is in hidden div. It opens in modal on click. Here is the code (coffee): $objects = $('*[rel="fotorama"]') $fotorama_div = $('.fotorama') $fotorama_div .on('fotorama:showend', (e, fotorama, extra) -> // resizing fotorama ).fotorama() fotorama = $fotorama_div.data('fotorama') console.log(fotorama) // here is undefined $objects.on 'click', -> // finding index of an image modal.open(