本文介绍了jQuery UI可排序,每个可排序的div包含一个iFrame在FF3中刷新但在IE7中没有刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using the jQuery UI Sortable on DIV which contains DIV tags. Inside of each of the sortable DIV's is an iFrame with a src= to a different site.

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

In IE7, sorting works as expected. If you've navigated within the iFrame, the iFrame retains the current state.

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

However, in FF3, when sorting stops and the iFrame is reloaded with the original url specified. This is not what I want.

我尝试过使用DIV / DIV和UL / LI,两者的行为都相同。

I've tried using both DIV/DIVs and UL/LIs and both behave the same.

推荐答案

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

This is a bug in FF (and apparently Safari 3.5/Win and Opera 9.5/Win): iframes reload if moved in the DOM tree. (jQuery sortable moves the node in the DOM tree when you drop it).

参见。

我之前得到的方法是指定一些附加到iframes父区域的区域,用于jQuery可操作的句柄。例如:

The way I've gotten around this before is to designate some area attached to the iframes parent the "handle" for jQuery sortable to operate on. For example:

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

你拖动句柄,而不是实际的iframe容器。在Drop上,您重新排列句柄,将iframe留在DOM中。这在我的案例中运作良好,但是YMMV。

You drag the "handle", and not the actual iframe container. On Drop, you re-arrange the handles, leaving the iframe where it is in the DOM. This worked well in my case but YMMV.

这篇关于jQuery UI可排序,每个可排序的div包含一个iFrame在FF3中刷新但在IE7中没有刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 09:09