Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何从Fancybox 2中删除边框?_Jquery_Fancybox - Fatal编程技术网

Jquery 如何从Fancybox 2中删除边框?

Jquery 如何从Fancybox 2中删除边框?,jquery,fancybox,Jquery,Fancybox,我在那边需要一些帮助。 这里我需要从fancybox iframe中删除白色边框 您可以通过单击红色按钮调用fancyBox。 我已经阅读了以前的文章,但无法解决这个问题。有什么想法吗?您可以通过将其添加到样式表中来删除它 iFrame的结构是这样的 <body style="overflow-x: hidden; "> <div style="max-width:550px; border: solid 15px #cc0033;" border="1">

我在那边需要一些帮助。 这里我需要从fancybox iframe中删除白色边框

您可以通过单击红色按钮调用fancyBox。
我已经阅读了以前的文章,但无法解决这个问题。有什么想法吗?

您可以通过将其添加到样式表中来删除它

iFrame的结构是这样的

<body style="overflow-x: hidden; ">
    <div style="max-width:550px; border: solid 15px #cc0033;" border="1">
       .
       .
       .
    </div>
</body>
但是,这将影响您为
#header
指定的任何边框属性,因为这也是
div:first child

所以做一个
!重要信息
用于
div#标题
边框属性(如果需要)

编辑

因为你想摆脱fancybox的背景

你需要加上这个

.fancybox-skin {
    background: transparent;
    box-shadow: none !important;
}
这是插件生成的默认类

而且

添加以下内容

html{
  background: white;
}
如果只希望背景位于红色边框内,则不要添加上面的
html
css,添加以下内容

body div:first-child {
     background: white !important;
}

调用fancy box脚本时,还可以将padding:0设置为选项。 在javascript中:

jQuery(document).ready(function($) {
    $("a.fancybox").fancybox({
         padding: 0
    });
});

没有填充。

尝试将css填充更改为0-对于该块,我认为我的问题有点不正确。我需要保留红色边框并移除Fancybox的白色边框。添加代码后,只有红色边框消失。我认为这是我问题的解决方案,但对我来说,它不适用于iframe。对我来说非常有效。谢谢你的帮助。
jQuery(document).ready(function($) {
    $("a.fancybox").fancybox({
         padding: 0
    });
});