?
Solved

Detecting when a mouse leave an Iframe

Posted on 2003-11-02
9
Medium Priority
?
1,024 Views
Last Modified: 2010-08-05
Please check http://www.visionsimulations.com/portal/index.htm   When the page loads, drop down one of the menus in the bottom frame. Now mouseover the picture buttons in the top frame. Notice that the menu in Iframe at the bottom flickers. I don't want this to happen. I want to turn off the menu in the bottom Iframe on mouseout. But I don't know that it's my pages that are displayed in the Iframe, since this is a portal page. So I think I need to detect this event from inside the page displayed in the Iframe. But how?

Roger
0
Comment
Question by:rdavis101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 9670766
Try this,

put this at the end of your script:

var to;

and adjust your div's to:

<div onMouseout="to=window.setTimeout('HideMenus()',100)" onMouseover = "window.clearTimeout(to);" ..............

Easynow
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9671474
0
 

Author Comment

by:rdavis101
ID: 9672464
Easynow,

Works, but results in some strange behavior...it always hides the menu DIV in a certain amount of time, even if the mouse is still over the menu DIV. Should I add onMousemove="window.clearTimeout(to);"   ?

Zontar,

Sadly, I haven't advanced far enough to understand cross-browser Javascript and CSS. Maybe someday.

Roger
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 11

Expert Comment

by:Zontar
ID: 9672589
"Someday" is already here. Start hitting the specs -- you'll find that the version 5+ browsers are about 85-90% interoperable now, and the differences are MUCH easier to bridge then when Dinosaurs Roamed The Ea-- I mean, when NS4 and MSIE4 were new.
0
 

Author Comment

by:rdavis101
ID: 9672766
Yup, I agree totally with you, it's just that I'm not actually a web developer or web designer. I just have a limited amount of time. Maybe I can get to it in a couple of months.
0
 
LVL 2

Accepted Solution

by:
mleeb earned 500 total points
ID: 9674725
Simple Solution:

Apply an OnMouseOut event to the iframe declaration.

Before:
    <IFrame id="ContentFrame" name="Content" frameborder="0" scrolling="auto" src="content.htm">
    </IFrame>

After:
    <IFrame id="ContentFrame" name="Content" frameborder="0" scrolling="auto" src="content.htm" onMouseOut='ContentFrame.HideMenus();'>
    </IFrame>

In order for this to work properly remove all instances of the killMenu variable and if statements referring to killMenu in your javascript, it honestly is serving no purpose besides complicating the code.
0
 

Author Comment

by:rdavis101
ID: 9676237
Mleeb,

Went through and stripped out the timer routine and the KillMenu variable, added your suggestion to the iFrame tag and it worked.

Thanks much...it ocurred to me that the onmouseout event could be added to the Iframe tag, but I thought that would generate a javascript error. And it does, but I clear the error by adding window.status=' ' right after the call the HideMenus in the iframe. So it works. :)
0
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 9677205
I have just checked the page and experience the same problem  i.e. menu flickering when you mouse over the images at the top.

Note: in your code where you have added the window.status='', you need to contain the onmouseout with " character,  not ' character.

Easynow
0
 

Author Comment

by:rdavis101
ID: 9679220
Dude, you're right...it was still messed up. I tell ya, I love this place. I get so much help here. I just uploaded the fix. Thanks for noticing that. :)

Roger
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question