我正在尝试打开 colorbox onclick。没关系。但现在我想将颜色框高度设置为自动(根据返回的内容高度的高度),并且浏览器的滚动条将在颜色框内容高度的高度内滚动。这是我的代码
$('body').on('click', 'a.post', function(e) {
e.preventDefault();
$.colorbox({
width: "850px",
height: "600px",
iframe: true,
href:this.href
});
});
有什么帮助吗? (提前致谢)
最佳答案
您可以尝试通过 height()
方法使用 Height:
var objHeight=$(window).height()-100; // reduce 100, so that it will fit in the container
$.colorbox({
width: "850px",
height: objHeight,
iframe: true,
href: this.href
});
关于jquery - 如何在jquery colorbox中设置自动高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14952804/