从父级对iframe中的元素进行排序。 (原型+ Scriptaculous)

时间:2011-07-25 12:01:10

标签: iframe prototypejs jquery-ui-sortable scriptaculous

我正在尝试使用prototype + scriptaculous从父框架中对iframe中的元素进行排序。我尝试创建可排序对象时收到以下错误:

“element.identify不是函数”

Firebug声称它在dragdrop.js的以下代码行失败(第734行)

“this.sortables [element.identify()] = options;”

由于设置的原因,我需要从父代运行的代码,而不是iframe。 我的功能如下:

function setSortable(){
//Create sortables
var doc = top.frames[0].document;
var sideContent = doc.getElementById('side-bar');
var mainContent = doc.getElementById('main-content');

if(sideContent){
    Sortable.create(sideContent, {tag:'table'});
}

if(mainContent){
    Sortable.create(mainContent, {tag:'table'});
}

}

是否可以从父框架运行scriptaculous代码而不在iframe页面中引用它?

非常感谢您的帮助。

0 个答案:

没有答案
相关问题