在Fancybox上的白色角落在边界半径

时间:2013-10-27 19:20:30

标签: jquery html css fancybox

我在Fancybox http://jsfiddle.net/LF27m/2/上应用边框半径,当我设置边框半径时,它会在Fancybox上创建白色角落。而且我不知道如何删除它。

我的css代码是:

#a1 div.popup-container{
height:350px;
width:400px;
background:#88B3D1;
-moz-border-radius:30px 30px 30px 30px; 
border-radius:30px 30px 30px 30px; 
-webkit-border-radius: 30px 30px 30px 30px;
overflow: hidden;
}

我的HTML COde是:

<div id="a1">
    <div class="popup-container">
        <div class="image-container">
            <img src="AllureFree Logo.gif" alt="Smiley face" width="130" height="130"/>
        </div>
        </br>
        <div>
            <h2 style="text-align:center; color:white;"> You must be 18 to shop on our Website.</h2>
            <h2 style="text-align:center; color:white;"> Please verify your birthdate.</h2>
        </div>
</div
</div>

1 个答案:

答案 0 :(得分:1)

它们来自应用于.fancybox-skin选择器(fancybox css文件)的样式。您可以覆盖自定义css文件中的默认值,如:

.fancybox-skin {
    background-color: transparent;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
}

还将padding: 0添加到您的fancybox脚本

$(document).ready(function () {
    $('html').append('<a class="fancybox" style="display:none" href="#a1"></a>');
    $('.fancybox').fancybox({
        padding: 0,
        afterClose: function () {
            $('a[href="#a1"]').remove();
        }
    });
    $('a[href="#a1"]').trigger('click');
});

参见 JSFIDDLE