locked
Second popup overlaps with first one in IE7 and IE8 - ASP.Net RRS feed

  • Question

  • We are using div tag in aspx and javascript functions to show context menu in our web application. In IE6 the sub menus in the context menu are getting displayed at the correct x and y coordinates what we have hard-coded in our application. But in IE7 and IE8, the sub menus are getting overlapped and in some machines the menus are going behind the window.

    For example consider the below code.
    The second popup is displayed at right offset location if the below code is saved as .html file and ran in IE7 or IE8. But the same code is not working with virtual directory and ran from IIS (IE7 and IE8). The same works in IE6 even if it is executed from virtual directory.
    <HTML>
    <HEAD>
    <TITLE>Nested popup windows</TITLE>
    <script>
    var firstPopupDiv = null;
    var popup = null;
    var vpopup = null;
    function tag_onclick()
    {
    var popup = window.createPopup();
    var div = popup.document.createElement("DIV");
    div.style.backgroundColor = "green";
    div.style.width = 200;
    div.style.height = 200;
    div.onclick = div_onclick;
    popup.document.body.appendChild(div);

    firstPopupDiv = div;
    vpopup = popup.document.parentWindow;
    popup.show(30, 30, 200, 200, maindiv);
    }
    function div_onclick()
    {
    var fpopup =
    vpopup.createPopup();
    fpopup.document.body.innerHTML = "<div id=\"MarkupSubMenu\" style=\"position:relative\">&nbsp;&nbsp;Markups</div>";
    fpopup.document.body.style.backgroundColor = "red";

    fpopup.show(230, 30, 200, 200, firstPopupDiv); // Not shown at 230!
    }
    </script>
    </HEAD>
    <BODY>
    <div id="maindiv" onclick="tag_onclick()">Click me</div>
    </BODY>
    </HTML>
    Any idea how to make it work? Do I miss any settings?

    • Changed type RNU Monday, March 1, 2010 2:57 AM
    Friday, February 26, 2010 9:01 AM