jQuery AJAX表到页面,但现在颜色框覆盖不再起作用 [英] jQuery AJAX table to a page but now the colorbox overlays no longer work

查看:91
本文介绍了jQuery AJAX表到页面,但现在颜色框覆盖不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AJAX来动态更新带有数据表的页面.

I am using AJAX to dynamically update a page with a data table.

表格成功添加到页面后,其中包含一些代码参考,可产生颜色框叠加弹出窗口.

When the table is successfully added to the page it contains some code reference to produce colorbox overlay pop ups.

但是,将表格拉入页面后,这些叠加层将不再起作用.

However, after the table has been pulled into the page these overlays no longer function.

有什么想法吗?我认为它们需要重新初始化还是什么?

Any ideas? I assume they need to be re-initialised or something?

推荐答案

我只是遇到了类似的问题.我不确定我是否100%理解该解决方案,但我基本上可以像这样工作:

I just ran into a similar problem. I'm not sure if I 100% understand the solution but I basically got it working like this:

    $.get('/ajax.php?action=roomList&restriction='+limit, function(data) {
      $('#roomList').html(data).fadeIn();
      $('.cb').colorbox({maxWidth:500,maxHeight:700});
    });

在我的链接中,我有class = cb可以连接到colorbox中.之所以有maxWidth和maxHeight,是因为在firefox上,由于某些原因,弹出的新颜色框非常庞大...

In my links I have class = cb to hook into colorbox. The maxWidth and maxHeight are there because on firefox the new colorbox that popped up was HUGE for some reason...

如果有人有更优雅的解决方案,请告诉我.我记得当我以前使用thickbox时,对于加载ajax的内容也有类似的过程,因为在加载原始页面时并没有新内容.

If anyone has a more elegant solution please let me know. I remember when I used to use thickbox there was a similar process for ajax loaded content since the new stuff wasn't around when the original page loaded.

这篇关于jQuery AJAX表到页面,但现在颜色框覆盖不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆