Here is the home page for the popular jquery-plugin galleria. I need to insert the download link to the right bottom corner for the active image. Now there is available statistic like (3/10), which indicates the current number from list.
Maybe someone already did this. What is the fastest way?
UPD: using the gearsdigital’s idea I wrote the code:
var gallery = Galleria.get(0);
gallery.bind(Galleria.IMAGE, function(e) {
imgHandle = e.imageTarget;
console.log(imgHandle);
console.log(imgHandle.attr('href'));
//$('.galleria-counter').append('<a href="'+imgHandle.attr('src')+'">Download</a>');
});
The first log line shows up something like:
<img width="584" height="438" src="http://....jpg" style="display: block; position: relative; left: 0px; top: -4px; opacity: 1;">
But how to get the src location, I see the error that attr function isn’t available.
I would try to get the current Source-Attribute from the current image and append this as link.
But a link like this will open the image separatly and not download ordinary. If you want a “real” Download you have to put this image in an zip archive.
This will produce something like that:
http://www.example.com/galleria/img/mygreatimage.jpg.zipWorks for me: