Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3967650
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:44:43+00:00 2026-05-20T03:44:43+00:00

Going to play with an Overlay from YUI 2 and IE6 (old stuff, but

  • 0

Going to play with an Overlay from YUI 2 and IE6 (old stuff, but I have to deal with these)… and encouter a problem. So, can you help with an idea or two ? 😀

Suppose the Overlay is created :

var newOverlay = new YAHOO.widget.Overlay("myOverlay" , 
                    {
            context: [someObjectToAttachTo, "tl", "bl"],
            monitorresize: false,
            iframe: false,
            zIndex: 900 });

some content is initalized (inside a div) :

var content = new StringBuffer();
content.append('<div id="containerDiv">');
content.append('whatever! some text for the overlay');
content.append('</div>');

an event is attached to the inner div so we know when it’s got the mouse over it :

YAHOO.util.Event.addListener('containerDiv', "mouseover", 
                     function() { alert('mouse in') });

“pour” the div into the overlay :

  newOverlay.setBody( content.toString() );

render the overlay, but invisible :

  newOverlay.render( document.body );
  newOverlay.hide();

Problem : even if the overlay is hidden, if you move the mouse in his area, you will get an alert saying “mouse in”.

This does not happen in IE7 or Mozilla. Seems that it is a bug and is related to

IE not repainting the DOM until after the execution context is complete

Source and some info here, another StackOverflow question

the Overlay is shown and hidden by this mechanism (note: the code described above is being updated here) :

 newOverlay.hideTimer = null; // new code
 YAHOO.util.Event.addListener('containerDiv', "mouseover", //event existed in above code
                    function() { 
                        alert('mouse in'); // line existed
                        clearTimeout(newOverlay.hideTimer) }); // added functionality
 YAHOO.util.Event.addListener('containerDiv', "mouseout", // new event 
                    function() { timedHide(newOverlay) });          

 newOverlay.setBody( content.toString() ); //old code
 newOverlay.render( document.body ); //old code
 newOverlay.hide(); //old code

the functions used above are :

 function customShow(overlayName) {
      var overlay = document.getElementById(overlayName);
      clearTimeout(overlay.hideTimer);
      overlay.syncPosition();
      overlay.show();
 }

 function timedHide(overlayName) {
      var overlay = document.getElementById(overlayName);
      overlay.hideTimer = setTimeout(function() {overlay.hide() }, 200);
 }

here is part two of the hide/show mechanism – the trigger div; please ignore the mix of html and js; you still can read it 😛

<span id="triggerSpan">I will show an Overlay</span>

and its events :

YAHOO.util.Event.addListener('triggerSpan', "mouseover", 
                     function() { customShow('myOverlay') });   
YAHOO.util.Event.addListener('triggerSpan', "mouseout", 
                     function() { timedHide('myOverlay') });

the object used in the creation of the overlay is :

var someObjectToAttachTo = document.getElementById('triggerSpan');

Long stuff…
now, can you see another way of passing by this IE bug ?
so the overlay does not take my mouse… I have stuff under that overlay that needs to be clicked and hovered (that part is not mentioned in the above code)

Can you see another way of creating/initiazing/showing/hidding that overlay ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:44:44+00:00Added an answer on May 20, 2026 at 3:44 am

    The solution was to change the display style of the containerDiv to none or to block when hiding/showing the overlay.

    Add some functions to the Overlay that change the style of the inner div:

    newOverlay.showOverlay = function() { 
        document.getElementById('containerDiv').style.display="block";
        newOverlay.show(); };
    
    newOverlay.hideOverlay = function() {
        document.getElementById('containerDiv').style.display="none";
        newOverlay.hide(); };
    

    and call those functions instead of calling overlay.show() or overlay.hide(), inside the functions customShow and timedHide

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was going to play around with TPL dataflow, but I can't seem to
Going mad now. I have a MVC solution that i've upgraded from MVC 1
I'm going to write a function to play a mp3 file from an URL
In my application i am going to place a video player that can play
this problem is going to make me bald. Save my hair plz. i have
I can play a video from a local resource (on the device). I can
I'm going through the TVAnimationGestures example from WWDC 2010. I have a question regarding
I've been using FLAG_WATCH_OUTSIDE_TOUCH to get touches from a system overlay in honeycomb, but
I'm trying to implement singleton concept in my play application. But before going into
I want check what play framework can do BUT I can't start any application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.