我在我的 aspx 元素中使用了 Colorbox,我使用了示例 1 中的 Iframe。我复制了 html 页面中提到的 css 和 js 文件,但是当单击链接时,它会在浏览器本身中打开页面,而我想要它会像示例中那样显示在框中。
这是代码 -
<a class='iframe' href="#" onclick="$.colorbox({href:'http://wikipedia.com', iframe:true, width:'90%', height:'90%'});">Click here</a>
最佳答案
您需要在页面上的元素中呈现颜色框:
<a class='iframe' href="#" onclick="$('#container').colorbox({href:'http://wikipedia.com', iframe:true, width:'90%', height:'90%'});">Click here</a>
<div id="container"></div>
关于javascript - Colorbox IFrame 在浏览器中打开一个 URL 而不是一个框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25216672/