1

我已经搜索了 3 天,但找不到答案
我尝试删除COLORBOX 弹出窗口底部的灰色区域,那里是关闭按钮的位置,但我找不到解决方法。我尝试添加删除导航,它仍然在弹出窗口的底部我有灰色的区域

我使用此代码

<script language="JavaScript">
jQuery(document).ready(function(){
       // $.fn.colorbox({scrolling:false, overlayClose:false, opacity:0.7, escKey:false, href:"#subscribe", 'open':true, 'inline':true, 'width':'auto', 'height':'auto'});
        //$('#cboxClose').remove();
          $.fn.colorbox({scrolling:false, overlayClose:false, opacity:0.7, escKey:false, href:"#subscribe", 'open':true, 'inline':true, 'width':'auto', 'height':'auto'});
          $('#cboxClose').remove();

        }
);
</script>
4

3 回答 3

1
#cboxLoadedContent{} //remove the margin-bottom:20px;

它对我有用。

于 2013-11-03T03:41:52.413 回答
0

Do you have a demo site that I can look at? I've removed the close button from colorbox in a site I'm working on (using the same $('#cboxClose').remove() jQuery snippet as you) and there's no grey area besides the normal shaded border around the colorbox content.

[EDIT] Ah! @Sudhir's answer prompted me to examine your code more closely - you haven't passed the .remove() code in as the onLoad function, so there may be no close button to remove when that line runs - it might not have been created yet!

Unfortunately, I don't have enough rep to add a comment to @sudhir's correct answer so I'll have to put it here instead.

The important part of @Sudhir's answer is the

onLoad: function(){
    $('#cboxClose').remove()
}

part. This will only run after the colorbox has fully loaded, at which point you should have a close button to remove.

于 2012-07-30T11:17:32.887 回答
0

我不了解其他任何人,但仅删除关闭按钮(您可以使用颜色框构造函数中的“closeButton:false”参数/值来完成)对我不起作用。我试图摆脱沿着颜色框底部运行的灰色/银色矩形框(控件容器)。关闭按钮被移除,但灰色的容器区域仍然存在。

最后,我必须创建 2 个新的 png 图像(用于边框的左侧和右侧),修改一个现有的 png 图像(colorbox-border.png)并修改 colorbox CSS 文件中的 3 行。所以,这就是你需要的:

保存这 3 个 png 并将它们添加到您的图像目录(或任何地方):

colorbox-border-bottom-left.png << colorbox-border-bottom-left.png

colorbox-border-bottom-middle.png << colorbox-border-bottom-middle.png (那里有一张图片!它只有 1x9 像素)

colorbox-border-bottom-right.png << colorbox-border-bottom-right.png

您还需要更新彩盒 CSS 文件。替换这 3 行:

#cboxBottomLeft{width:14px; height:43px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-controls.png) no-repeat 0 -32px;}
#cboxBottomCenter{height:43px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-border.png) repeat-x bottom left;}
#cboxBottomRight{width:14px; height:43px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-controls.png) no-repeat -36px -32px;}

...用这 3 行:

#cboxBottomLeft{width:14px; height:9px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-border-bottom-left.png) no-repeat}
#cboxBottomCenter{width:1px; height:9px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-border-bottom-middle.png) repeat-x bottom left;}
#cboxBottomRight{width:14px; height:9px; background:url([WHEREVER_UR_IMAGES_ARE]/colorbox-border-bottom-right.png) no-repeat}

如果您不使用这些名称保存它们,请不要忘记更改 CSS 文件中的 png 的名称,例如 colorbox-border-bottom-...。

这是一个结果示例:

在此处输入图像描述

于 2013-10-18T17:19:48.260 回答