日期:2014-05-16  浏览次数:20495 次

jquery colorbox 自动弹窗
jquery colorbox 能实现自动弹窗吗     就是页面加载完成后自动弹出个colorbox窗口   如果不能 那什么样的插件可以实现这个功能
------解决方案--------------------

<!doctype html>
<head>
    <title>My Automatic ColorBox</title>
    <link rel="stylesheet" type="text/css" href="../link/to/jquery.colorbox.css">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script type="text/javascript" src="../jquery.colorbox.js"></script>
    <script>$(document).ready(function(){$.colorbox({inline:true, href:".ajax"});});</script>
</head>
<body>
    <h2>Other Content Types</h2>
    <div class='ajax' style='display:none'><a href="../content/daisy.jpg" title="Homer Defined">Outside HTML (Ajax)</a></div>
</body>

------解决方案--------------------
$(function(){//加载完毕直接$.colorbox就会弹窗了
 $.colorbox({ overlayClose: false
        , href: 'b.html'
        , width: 400
        , height: 200
        , iframe: true
        });
});