Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.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
Fancybox jQuery中的CSS渐变?_Jquery_Css_Webkit_Fancybox_Gradient - Fatal编程技术网

Fancybox jQuery中的CSS渐变?

Fancybox jQuery中的CSS渐变?,jquery,css,webkit,fancybox,gradient,Jquery,Css,Webkit,Fancybox,Gradient,我正在调整我的fancybox jQuery,以便在打开lightbox后有一个背景渐变。我对jQuery不太在行,但fancybox为我提供了以下功能来定制我的背景色: $(".fancybox-effects-c").fancybox({ wrapCSS : 'fancybox-custom', helpers : { overlay : { css : { 'background' : 'rgba(255,255,255,1)'

我正在调整我的fancybox jQuery,以便在打开lightbox后有一个背景渐变。我对jQuery不太在行,但fancybox为我提供了以下功能来定制我的背景色:

$(".fancybox-effects-c").fancybox({
wrapCSS    : 'fancybox-custom',
helpers : {
    overlay : {
        css : {
            'background' : 'rgba(255,255,255,1)'
            }
        }
    }
});
因此,我将“rgba(255255255,1)”替换为“webkit线性渐变(顶部,#B7F9EE,#FAD19C)”修复;'成功了,但现在我不知道如何为其他浏览器添加声明。我试着这样做:

css : {
    'background' : '-moz-linear-gradient(top, #B7F9EE, #FAD19C) fixed',
    'background' : '-webkit-linear-gradient(top, #B7F9EE, #FAD19C) fixed',
    'background' : '-ms-linear-gradient(top, #B7F9EE, #FAD19C) fixed'
        }

但它似乎只是输出了最后一个声明,而忽略了之前的声明。

您还可以使用fancybox
tpl
API选项为fancybox
皮肤设置一个新类,如:

jQuery(document).ready(function ($) {
    $(".fancybox").fancybox({
        tpl: {
            wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin myGradient"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>'
        }
    });
}); // ready

请参见

您可以尝试添加带有渐变背景的自定义类尝试只添加一个带有逗号分隔符的
背景,否则我会照rajesh说的做。谢谢您的评论!我试过这样做,但没有成功,可能是因为我的灯箱不是内联的,它们是ajax。如果找不到其他解决方案,我会将它们更改为内联。
.myGradient {
    background :         linear-gradient(top, #B7F9EE, #FAD19C) fixed;
    background :    -moz-linear-gradient(top, #B7F9EE, #FAD19C) fixed;
    background : -webkit-linear-gradient(top, #B7F9EE, #FAD19C) fixed;
    background :     -ms-linear-gradient(top, #B7F9EE, #FAD19C) fixed;
}