Sort elements in iframe from parent. (Prototype + Scriptaculous)
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.
精彩评论