【问题标题】:jQuery UI sortable, each sortable div contains an iFrame gets refreshed in FF3 but not in IE7jQuery UI 可排序,每个可排序的 div 包含一个 iFrame 在 FF3 中刷新,但在 IE7 中不刷新
【发布时间】:2009-04-09 21:46:39
【问题描述】:

我在包含 DIV 标签的 DIV 上使用 jQuery UI Sortable。每个可排序的 DIV 内部都有一个 iFrame,其 src= 指向不同的站点。

在 IE7 中,排序按预期工作。如果您在 iFrame 中导航,则 iFrame 会保留当前状态。

但是,在 FF3 中,当排序停止并且 iFrame 会重新加载指定的原始 url。这不是我想要的。

我尝试过同时使用 DIV/DIV 和 UL/LI,它们的行为相同。

【问题讨论】:

标签: javascript jquery jquery-ui jquery-ui-sortable


【解决方案1】:

这是 FF 中的一个错误(显然是 Safari 3.5/Win 和 Opera 9.5/Win):如果在 DOM 树中移动 iframe,则会重新加载。 (当你删除它时,jQuery sortable 会在 DOM 树中移动节点)。

https://bugzilla.mozilla.org/show_bug.cgi?id=254144

我之前解决这个问题的方法是指定一些附加到 iframe 父级的区域作为 jQuery 可排序操作的“句柄”。例如:

+-----------------------+
| Drag Me | iframe here |
+---------+             |
          |             |
          +-------------+

您拖动的是“句柄”,而不是实际的 iframe 容器。在 Drop 时,您重新排列句柄,将 iframe 留在 DOM 中的位置。这在我的情况下效果很好,但 YMMV。

【讨论】:

  • 哎哟。看来我有一些工作要做。我已经有了一个 Dragme 手柄。 dominicminicoopers.com/jQuery/sortable.htm 但它仍然会恢复。
  • 是的,我侥幸成功了,因为一次只显示一个 iframe。从您的演示来看,这似乎行不通。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-12-13
  • 2012-06-07
  • 2019-06-27
  • 1970-01-01
  • 1970-01-01
  • 2011-02-09
  • 2012-03-11
相关资源
最近更新 更多