Note that there are some explanatory texts on larger screens.

plurals
  1. POFrame position in JavaScript
    primarykey
    data
    text
    <p>I am having a frame-based webpage with 3 frames. A topliner, a navigation on the left side and a content frame on the bottom right side.</p> <p>Now, I want to show up a popup-menu when the user right-clicks on the content-frame. Because a div-container can not go out of the frame, my idea was, placing the whole frame-page into a new iframe. In that page I could have a second iframe which is my popup-menu.</p> <p>So now, I am having this layout:</p> <pre><code>&lt;html&gt; (start-page) &lt;iframe (real content) &lt;frameset top-frame navigation-frame content-frame &gt; &gt; &lt;iframe&gt; (my popup-menu, positioned absolutelly and hidden by default) &lt;/html&gt; </code></pre> <p>In my content-frame I am having a "onmouseover"-event assigned to the body-tag. This event should open the popup-iframe at the current mouse-position. And exactly here is my problem: How to get the mouse-coordinates relativelly to the top-website (start-page in my draft)?</p> <p>Currently I am having this mouseDown-function (works in IE only, right now - but getting it working in FF &amp; Co shouldn't be the problem...)</p> <pre><code>function mouseDown(e) { if (window.event.button === 2 || window.event.which === 3) { top.popupFrame.style.left = event.screenX + "px"; top.popupFrame.style.top = event.screenY + "px"; top.popupFrame.style.display = ""; return false; } } </code></pre> <p>As you can see, the "event.screenX" and "screenY" - variables are not that variables I can use, because they are not relative to the mainpage.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload