Add caption display for described images in Fancybox gallery
This commit is contained in:
parent
2eab25e7c1
commit
36eced28b8
|
@ -1,13 +1,10 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$.fancybox.defaults.loop = "true";
|
$.fancybox.defaults.loop = "true";
|
||||||
// this disables the colorbox hook found in frio/js/modal.js:34
|
$.fancybox.defaults.afterLoad = function(instance, current) {
|
||||||
$("body").off("click", ".wall-item-body a img");
|
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
|
||||||
|
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
|
||||||
// Adds ALT/TITLE text to fancybox
|
};
|
||||||
$('a[data-fancybox').fancybox({
|
$.fancybox.defaults.caption = function (instance, slide, caption) {
|
||||||
afterLoad : function(instance, current) {
|
return slide.$thumb.attr('alt');
|
||||||
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
|
};
|
||||||
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user