Jquery Colorbox issue with firefox

Jquery Colorbox issue with firefox

本文关键字:firefox with issue Colorbox Jquery      更新时间:2023-09-26

我通过javascript填充中继器中的锚链接,我用colorbox iframe弹出这些链接。它在IE7、Safari、Chrome中运行良好,但在Forefox(14.1)中则不然。

在firefox中,它在一个新窗口中打开,而不是在colorbox iframe中打开。

function BidCountFormatter(BidCount, AuctionID) {
if (parseInt(BidCount) > 0)
    return "<b><a class=auctionhistorybox href=popupauctionhistory.aspx?auctionid=" + AuctionID + ">" + BidCount + "</a></b>";
else
    return "--";
}
$(document).ready(function () {
          $(".auctionhistorybox").colorbox({ iframe: true, width: "35%", height: "60%" });
      });

由于锚链接是在运行时动态生成的,因此我不得不在那之后重新绑定ColorBox事件:

而不是做"$(document).ready"

$(document).ready(function () {
 $(".auctionhistorybox").colorbox({ iframe: true, width: "35%", height: "60%" });
});

在中继器中生成"auctionhistorybox"链接后,我调用了以下函数

function bindColorBoxEvents() {
$('.auctionhistorybox').each(function (i) {
    $(this).unbind('click');
    $(".auctionhistorybox").colorbox({ iframe: true, width: "50%", height: "95%" });
});

}

感谢您的帮助@Vector。