Reputation: 33431
Consider the following code:
function hide(aFrame) {
var frameset = aFrame.frameset; //<-- this doesn't work
$(frameset).attr('cols', '0,*');
}
//hide parent frame
hide(window.parent);
//hide current frame
hide(window);
I have a function that takes a frame and I would like to hide it by changing the cols
of its frameset. jQuery may be used to answer the question (but a pure JavaScript solution is okay as well).
Upvotes: 2
Views: 252
Reputation: 33431
The trick seems to be querying the parent document:
function hide(aFrame) {
var frameset = aFrame.parent.document.getElementsByTagName('frameset');
$(frameset).attr('cols', '0,*');
}
Upvotes: 1