Re[2]: Menu doesn't go away when using iframes
2005/09/02 19:33
Viewed 14755 times
Replies: 1/3

As a follow up to Mike Gorman's question - We really need an IFRAME solution because switching to regular frames will require rework that we can't afford to do right now. I am working with Mike Gorman and I will be handling this issue. We have the ability to add whatever javascript listeners we need to on all content that displays in the IFRAME. I am pretty sure that all we need to do is to call some function on the dynarch component every time a page loads into the IFRAME. If you can send a patch then I can just go head an fix it on our end -- until the next version of this software is released with this fix.

Re[3]: Menu doesn't go away when using iframes
2005/09/02 19:45
Viewed 16984 times
Replies: 1/2

In fact, I wanted to tell you this by email—but I wasn't sure you work with Mike on this issue.

Yes, I did find an workaround and it will be very easy to apply it in the next release of DynarchMenu (which will see the light sometime next week).  But if you're really in a hurry, here are the essential steps.

1) Add the following code anywhere in your JavaScript files, after loading hmenu.js:

DynarchMenu.watchFrame = function(f, w) {
if (typeof w == "undefined")
w = window;
try {
DynarchMenu._addEvent(f, (is_ie || is_opera) ? "keydown" : "keypress",
w.DynarchMenu._documentKeyPress);
DynarchMenu._addEvent(f, "mousedown",
w.DynarchMenu._documentMouseDown);
DynarchMenu._addEvent(f, "mouseup",
w.DynarchMenu._documentMouseUp);
DynarchMenu._addEvent(f, "mouseover",
w.DynarchMenu._documentMouseOver);
} catch(e) {};
};

function initFrame(frame) {
var win = frame.contentWindow || frame.window || frame;
DynarchMenu.watchFrame(win);
DynarchMenu.watchFrame(win.document);
}

2) Add an onload handler to your IFRAME like this:

<iframe src="whatever.html" onload="initFrame()"></iframe>

And hopefully that's it. :-)  All problems gone.

I am sorry things get so complicated, but unfortunately that's the situation...  I did a lot of tests and there's no easy and portable way for us to do this automatically—so you'll have to add that “onload” handler.  Otherwise, events get lost and it happens as Mike described.

I hope this trick will be useful to you.  In the next version, DynarchMenu will include the "watchFrame" function so you'll only need to write the "initFrame" function.

Please let me know if it solved the problem.

Best regards,
-Mihai

last
Re[4]: Menu doesn't go away when using iframes
2005/09/06 05:10
Viewed 19137 times
Replies: 1/1

I tried the javascipt functions you provided - they worked. Thank you.

last
Google