Re[3]: Menu doesn't go away when using iframes
2005/09/02 19:45
Viewed 16982 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

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

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

last
Re[5]: Menu doesn't go away when using iframes
2006/02/10 20:09
Viewed 17597 times
Replies: 0/0

Hi, i am experiencing almost the same issue,

i have a context Menu in the iFrame, and it doesn't hide after you mouse away from it...
i use FF1.5 and DynarchMenu-2.8.1

Any help would be appreciated

last
Google