开发者

Facebox content is added multiple times

In the Facebox JavaScript plug-in, my content is adding multiple times.

Here is my code for initializing the Facebox code

$(document).ready(function(){
  开发者_如何学Go  $('a[rel*=facebox]').facebox();
}); 

Any idea why the content is generating multiple times?


here we go

$(document).bind('beforeReveal.facebox', function() {
  $("#facebox .content").empty();
});


My Problem is same, but after looking closely in debugger i found that facebox previous request can not stops and it get continues, like one click one request sending, 2nd click two request sending although first and second request Gives OK message, it means action performed successfully. However for every click previous request also get call like adding each request to a stack and and stack doesn't flush.

It's making facebox pop-up slower in log run (ie. When i am clicking multiple time. It's response time delayed.)


I know this is old however I have just resolved the exact same issue. Mine kept adding an additional GET call with each Facebox request so I resolved it by removing:

rel="facebox"

from the affected elements, added an ID to each one and called Facebox with:

$("#elementID").click(function(){
    $.facebox({ ajax: "my-facebox-file.html" });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜