gpt4 book ai didi

jquery - 更改 fancybox 关闭按钮标题/工具提示

转载 作者:行者123 更新时间:2023-11-30 23:55:58 24 4
gpt4 key购买 nike

有没有办法翻译 fancybox 中的工具提示,例如关闭按钮上的工具提示?

我已经在 afterShow 回调中完成了此操作,将值更改为丹麦语,并且似乎有效。或者是否有更好的方法来更改它?

<script type="text/javascript">
$(document).ready(function() {
$("a.mapoverlay").fancybox({
width : '90%',
height : '90%',
fixed: false,
autoSize : false,
autoCenter : true,
afterLoad : function() {
loadMap();
},
afterShow : function() {
$("a.fancybox-close").attr("title", "Luk");
}
});
});
</script>

编辑:这段代码似乎工作正常。

我在写这篇文章时遇到了语法错误..我想你错过了一些东西?语法错误:意外的标记}

我在这里看到了这篇文章:https://github.com/fancyapps/fancyBox/issues/7

<script type="text/javascript">
$(document).ready(function() {
$("a.mapoverlay").fancybox({
width : '90%',
height : '90%',
fixed: false,
autoSize : false,
autoCenter : true,
afterLoad : function() {
loadMap();
},
tpl: {
closeBtn: '<div title="Test" class="fancybox-item fancybox-close"></div>'
}
});
});
</script>

最佳答案

您可以使用.tpl选项:

$(document).ready(function() {
$("a.mapoverlay").fancybox({
width : '90%',
height : '90%',
fixed: false,
autoSize : false,
autoCenter : true,
afterLoad : function() {
loadMap();
},
tpl: {
'<a title="Your title here!" class="fancybox-item fancybox-close" href="javascript:;"></a>'
}
});
});

编辑:tpl选项的正确格式是

tpl : {
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>'
}

关于jquery - 更改 fancybox 关闭按钮标题/工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12561800/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com