javascript 如何在新版本的fancybox中将标题隐藏为默认值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8258438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I hide the title as default in the new version of fancybox
提问by lisburnite
The previous version had a 'titleShow': false,
setting, however it seems to have been removed for the new version.
以前的版本有一个'titleShow': false,
设置,但是新版本似乎已将其删除。
I know I can hide it programmatically using jquery but I'd prefer to use a built in feature to remove it??
我知道我可以使用 jquery 以编程方式隐藏它,但我更喜欢使用内置功能来删除它?
回答by Janis
You can disable title helper -
您可以禁用标题助手 -
$(".fancybox").fancybox({
helpers: {
title: null
}
});
回答by Meg Ann
Top disable the title;
顶部禁用标题;
$(".fancybox").fancybox({ helpers: { title: false} });
$(".fancybox").fancybox({ helpers: { title: false} });
回答by liutis
I used this css to hide title:
我用这个 css 来隐藏标题:
#fancybox-title-float-wrap {
display: none;
}
回答by Manimegalai
In CSS file: give visibility:hidden
in
在CSS文件:给visibility:hidden
在
fancybox-title-float-left,
fancybox-title-float-main,
fancybox-title-float-right,
回答by Kernel Panic
in the .css file, change:
在 .css 文件中,更改:
.fancybox-opened .fancybox-title {
visibility: visible;
}
to
到
.fancybox-opened .fancybox-title {
visibility: hidden;
}
Tested on 2.0.5.
在 2.0.5 上测试。
回答by lalibi
If you just delete the title attribute from the the anchor tag there is not title shown. Doesn't that work for you?
如果您只是从锚标记中删除标题属性,则不会显示标题。那不适合你吗?
回答by lisburnite
I had to rip out the line of code that appends the title as I could find no way of doing it using the API..
我不得不撕掉附加标题的代码行,因为我找不到使用 API 来做到这一点的方法..
c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.outer)
回答by Mike
title: null
标题:空
I have checked it and it works for me.
我已经检查过了,它对我有用。