I am building a site using the Fotorama (www.fotorama.io) Jquery plugin. I have been using this code to generate custom thumbnails. I need to somehow catch the press on the picture to go.
$("#fotorama_right_div").on("click", 'img', function() {
$('#fotorama_right_div').one('fotorama:showend', function (e, fotorama) {
console.log($(fotorama.activeFrame).attr('url'));
});});
But my code is not correct, I do not always get the desired picture.
How can I catch a picture and click on the option to receive data from radar images?
<img data-url="http:://ya.ru" src="http://s.fotorama.io/1.jpg">...
You are using the attr method
$(fotorama.activeFrame).attr('url')
White the attribute's name is data-url
either use the data("url") method or attr("data-url")
Could you give that a try?