【发布时间】:2016-12-23 08:32:54
【问题描述】:
我使用 Fancybox (3 beta),标题设置不会改变任何内容,但其他设置适用于其他属性(拇指、叠加颜色、..)。
<script type="text/javascript">
jQuery(function ($){
$(document).ready(function(){
$(".fancybox-thumbs").fancybox({
padding: 0,
margin: 10,
closeBtn : true,
helpers :
{
title: {
position: 'top',
},
thumbs:
{
width : 40,
height : 40,
}
},
beforeShow : function() {
var alt = this.element.find('img').attr('alt');
this.inner.find('img').attr('alt', alt);
this.title = alt;
},
});
});
});
</script>
我也尝试将图像的“alt”属性设置为链接的标题,但它根本不起作用。 (但我不确定这是写函数的正确位置)
【问题讨论】: