ColorboxDocsで述べたように
コールバック「onOpen」(およびおそらく「onLoad」)を設定できます。これは、カラーボックスがターゲットで指定されたコンテンツの読み込みを開始する前に起動して、変更する機会を与える必要があります。
$(function () {
$(".button").colorbox({
width: "50%",
height: "50%%",
iframe: true,
href: "/abc",
opacity: 0.6,
onOpen: function(){
// modify target here
}
});
});
更新
おそらくより単純な解決策-カラーボックスは静的な値の代わりに関数の使用を可能にします
$(function () {
$(".button").colorbox({
width: "50%",
height: "50%",
iframe: true,
href: function(){
// Since I can't see your markup I can't provide exact solution
// but if your .button elm is an anchor then use
var url = $(this).attr('href');
// if you are obtaining the url from diff. elm, grab it from there
// such as $('#your_element).attr('href')
return url;
},
opacity: 0.6
});
});