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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 02:48:46  来源:igfitidea点击:

How can I hide the title as default in the new version of fancybox

javascriptjqueryfancybox

提问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:hiddenin

在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.

我已经检查过了,它对我有用。