Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/478.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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
Javascript fancybox-更改关闭按钮颜色_Javascript_Css_Fancybox - Fatal编程技术网

Javascript fancybox-更改关闭按钮颜色

Javascript fancybox-更改关闭按钮颜色,javascript,css,fancybox,Javascript,Css,Fancybox,我确实下载了fancybox,我正在尝试更改关闭按钮的颜色 我尝试过,但没有任何结果: .fancybox-close { position: absolute; top: -18px; right: -18px; width: 36px; height: 36px; cursor: pointer; z-index: 8040; color : #ff0033 !important; //color added } 欢迎提供任何提示。您可以安装firebug

我确实下载了fancybox,我正在尝试更改关闭按钮的颜色

我尝试过,但没有任何结果:

.fancybox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 8040;
  color : #ff0033 !important; //color added
}

欢迎提供任何提示。

您可以安装firebug firefox插件,然后右键单击关闭按钮-->使用firebug检查Eliment。然后您可以找到css名称

您可以编辑jquery.fancybox.x.x.x.css

或者,您可以将下面的代码添加到页面css中

.fancybox-close {
 background: none !important; //This will disappear close button image
 position: absolute !important;
 top: -18px !important;
 right: -18px !important;
 width: 36px !important;
 height: 36px !important;
 cursor: pointer !important;
 z-index: 8040 !important;
 color : #ff0033 !important; //color added
}

如前所述,fancybox默认使用图像。这个“

您可以在文件
jquery-fancybox-x.x.x.css

(其中x是版本),元素名为#fancybox close

这是一个缓存问题。要解决此问题,请尝试在图像URL中添加
?version=2

用法:


背景:透明url('image.png?version=2')-40px 0px

默认情况下,Fancybox使用图像精灵作为其关闭按钮。基本上这是一个图像,我知道摇滚。我确实在photoshop中将它改成了红色,但它仍然是黑色。这对我来说很奇怪。它仍在显示旧图像。我检查了图像文件夹,图像是新的。我确实检查了网址,它是正确的。我确实关闭了浏览器以刷新缓存。不可能。图像还在那里。我通过搜索整个站点文件夹进行了检查,没有发现任何重复的图像。请尝试在图像URL
?version=2
中添加此内容,例如
image.png?version=2
。请在问题中添加您的html
。它成功了?版本=3。非常感谢摇滚乐!!!你能给你的主要答案添加解决方案吗?请断开图片链接。我只是在编辑你指的文件#fancybox close不存在,但是。fancybox close我现在正在按照我说的更改图标。链接未断开,您可以访问并查看图像的外观。只需更改背景属性该链接将我指向“禁止”消息。无论如何,RockMyAlgorithm有正确的解决方案。非常感谢你的帮助。是的,我以前做过。我正在编辑主要的fancybox css文件。我发现路径是正确的。它指向文件夹“img”和图像“fancybox_sprite.png”。通过检查,url显示不存在的旧图像。它是在Photoshop中更改的。我确实清理了缓存,关闭了浏览器。。。结果不会改变。整个站点中没有重复的图像。RockMyAlgorithm添加了正确的解决方案。非常感谢您的帮助。这是因为您的图像已保存在缓存中。这就是为什么它不会换成新的。