mirror of
https://github.com/friendica/friendica
synced 2024-11-17 20:23:40 +00:00
Add caption display for described images in Fancybox gallery
This commit is contained in:
parent
2eab25e7c1
commit
36eced28b8
1 changed files with 8 additions and 11 deletions
|
@ -1,13 +1,10 @@
|
|||
$(document).ready(function() {
|
||||
$.fancybox.defaults.loop = "true";
|
||||
// this disables the colorbox hook found in frio/js/modal.js:34
|
||||
$("body").off("click", ".wall-item-body a img");
|
||||
|
||||
// Adds ALT/TITLE text to fancybox
|
||||
$('a[data-fancybox').fancybox({
|
||||
afterLoad : function(instance, current) {
|
||||
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
|
||||
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
|
||||
}
|
||||
});
|
||||
});
|
||||
$.fancybox.defaults.afterLoad = function(instance, current) {
|
||||
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
|
||||
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
|
||||
};
|
||||
$.fancybox.defaults.caption = function (instance, slide, caption) {
|
||||
return slide.$thumb.attr('alt');
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue