Facebox 内容被多次添加
在 Facebox JavaScript 插件中,我的内容被多次添加。
这是我用于初始化 Facebox 代码的代码
$(document).ready(function(){
$('a[rel*=facebox]').facebox();
});
知道为什么内容会多次生成吗?
In the Facebox JavaScript plug-in, my content is adding multiple times.
Here is my code for initializing the Facebox code
$(document).ready(function(){
$('a[rel*=facebox]').facebox();
});
Any idea why the content is generating multiple times?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
开始了
here we go
我的问题是一样的,但是在调试器中仔细查看后,我发现facebox之前的请求无法停止并且它会继续,就像单击一个请求发送,第二次单击两个请求发送虽然第一个和第二个请求给出了OK消息,这意味着执行了操作成功地。然而,对于每次点击,先前的请求也会得到调用,例如将每个请求添加到堆栈中,并且堆栈不会刷新。
它使 Facebox 弹出窗口在日志运行中变慢(即,当我多次单击时。响应时间延迟。)
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.)
我知道这已经很旧了,但我刚刚解决了完全相同的问题。我的不断为每个 Facebox 请求添加一个额外的 GET 调用,因此我通过以下方式解决了这个问题:
从受影响的元素中删除:,为每个元素添加一个 ID,并使用以下命令调用 Facebox:
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:
from the affected elements, added an ID to each one and called Facebox with: