jQuery 如何使用颜色框显示 iframe
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5469704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 19:13:31 来源:igfitidea点击:
how to display iframe with colorbox
提问by GoldenBird
How to display iframe with colorbox. I tried following.
如何使用颜色框显示 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>
回答by Santosh Linkha
By looking at your code, I think you are not putting the scripts right. I must be like this.
通过查看您的代码,我认为您没有正确放置脚本。我一定是这样的。
<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>
On Firefox
在 Firefox 上
On chrome
镀铬