开发者

Sort elements in iframe from parent. (Prototype + Scriptaculous)

开发者 https://www.devze.com 2023-03-23 05:19 出处:网络
I am trying to sort elements in an iframe from the parent frame using prototype + scriptaculous. I am receiving the following error when I try to create the sortable object:

I am trying to sort elements in an iframe from the parent frame using prototype + scriptaculous. I am receiving the following error when I try to create the sortable object:

"element.identify is not a function"

Firebug is stating it is failing on the following line of code from dragdrop.开发者_StackOverflow中文版js (Line 734)

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

Due to the setup I need all code running from the parent, not the iframe. My function looks like this:

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'});
}

}

Is it possible to run the scriptaculous code from the parent frame without referencing it in the iframe page?

Your help would be much appreciated.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号