Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.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
Php 颜色盒平滑淡入内容_Php_Javascript_Jquery_Css - Fatal编程技术网

Php 颜色盒平滑淡入内容

Php 颜色盒平滑淡入内容,php,javascript,jquery,css,Php,Javascript,Jquery,Css,我有一个问题:我使用colorbox来生成那些jQuery弹出窗口()。问题是,我希望通过ajax平滑地淡入内容,而不需要加载div,您可以在内容显示之前看到加载div 当我通过不透明度禁用加载div时,它就消失了,但我无法平滑地淡入我的内容。它只是突然出现 <script type="text/javascript"> $(document).ready(function(){ $(".register_link").colorbox

我有一个问题:我使用colorbox来生成那些jQuery弹出窗口()。问题是,我希望通过ajax平滑地淡入内容,而不需要加载div,您可以在内容显示之前看到加载div

当我通过不透明度禁用加载div时,它就消失了,但我无法平滑地淡入我的内容。它只是突然出现

<script type="text/javascript">
$(document).ready(function(){
    $(".register_link").colorbox({
        initialWidth:'886',
        initialHeight:'410',

        fixed:'true',
        scrolling:'false',
        transition:'fade',
        onOpen: function(){
             $("#colorbox").css("opacity", 0);
                },
        onComplete: function(){
             var title = 'Register';
             $('#cboxTitle').text(title);
             
             $("#colorbox").css("opacity", 1);
        }
    });
});
</script>

$(文档).ready(函数(){
$(“.register\u link”).colorbox({
初始宽度:'886',
初始高度:'410',
修正:'true',
滚动:'false',
过渡:'fade',
onOpen:function(){
$(“#colorbox”).css(“不透明度”,0);
},
onComplete:function(){
变量标题='寄存器';
$('cboxTitle')。文本(标题);
$(“#colorbox”).css(“不透明度”,1);
}
});
});

您可以使用jQuery
animate()
函数,而不是
.css()
函数

onComplete: function(){
     var title = 'Register';
     $('#cboxTitle').text(title);

     $("#colorbox").animate({"opacity": 1});
}

您可以使用jQuery
animate()
函数,而不是
.css()
函数

onComplete: function(){
     var title = 'Register';
     $('#cboxTitle').text(title);

     $("#colorbox").animate({"opacity": 1});
}

很好用!非常感谢你!你救了我一天!:)很好用!非常感谢你!你救了我一天!:)