如何用colorbox显示iframe

Gol*_*ird 3 html jquery colorbox

如何使用colorbox显示iframe.我试过跟随.

$.colorbox({inline:true, href:"#html_content", onLoad:function(){
alert("Colorbox Loaded")
}});

<body class="html_body" id="html_content_body">
<div id="html_content">
<form id="ajaxadd" action="/patient_add/" method="post" name="FormName" class="prettyform">
{% csrf_token %}

<table id="table_one" width="448" border="0" cellspacing="2" cellpadding="0">
....
</table>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

San*_*kha 8

通过查看您的代码,我认为您没有正确地编写脚本.我必须是这样的.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" href="colorbox.css"/>
<script>
    $(function ()
    {
        $(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});    
    })
</script>
<a class='example6' href="http://google.com">Outside Webpage (Iframe)</a>
Run Code Online (Sandbox Code Playgroud)

在Firefox上

在Firefox上

在铬 在此输入图像描述