我試圖使用標題和「標題」從圖像alt標籤與fancybox 2 ...由於某種原因,我似乎無法從$(本).attr( '標題')的工作,字幕工作...Fancybox 2自定義標題和標題[來自A(標題)和IMG(替代品)
$('.fancybox').fancybox({
beforeShow : function() {
this.title = '<div class="new-title-title">' + $(this).attr('title') + '</div><div class="new-title-alt">' + $(this).children('img:first').attr('alt') + '</div>';
},
helpers : {
title: {
type: 'inner',
beforeShow: function(opts) {
console.log('beforeShow title helper');
},
},
},
});
標題從$(本)。兒童( 'IMG:第一')ATTR( 'ALT')說。未定義的...我知道我必須失去了一些東西簡單...