Solved

Detecting when a mouse leave an Iframe

Posted on 2003-11-02
9
978 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 125 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

756 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