newbie Q: menu that slides over second frame

I

Ikke

Hi,

Forgive my ignorance, but I'm new to JavaScript.
I've got a little script that slides a table (menu) when the mouse goes over
it. This works fine (see 'test file') but the problem is; when this menu is
loaded in a frame (with a limited width) the menu slides underneath the
other (on the right hand) frame. How do I get this script displaying the
menu over the other frame?

all tips, links, complete solutions :)) and help are most welcome...

Thanks,

Ikke



--------------------------------- test
le -------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>

<style type="text/css" title="untitled" media="screen">
table
{
font-size:12;
color: rgb(124, 224, 224);
font-family: helvetica, sans-serif;
font-style: normal;
}

span
{
border:groove 0px;
padding:0;
font-family:arial;
font-size:12;
width:0;
height:0;
position:absolute;
top:0;
left:-252
}
</style>

<script type="text/javascript">
function showmenu(elmnt)
{
elmnt.style.left="0"
}

function hidemenu(elmnt)
{
elmnt.style.left="-252"
}
</script>


</head>
<body>

<span onmouseover="showmenu(this)" onmouseout="hidemenu(this)">
<table width="300" border="0" frame="above" rules="none" cellspacing="0"
cellpadding="0" align="top" bgcolor="rgb(50,50,84)">
<tr>
<td width="10%" rowspan="3"></td>
<td width="90%"><br /><pre><b><a href="" name="" target="" class="" id=""
style="">Home</a></b></pre></td>
<td valign="bottom" rowspan="3">Untitled</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</span>

</body>
</html>
 
E

Evertjan.

Ikke wrote on 10 nov 2003 in comp.lang.javascript:
I've got a little script that slides a table (menu) when the mouse
goes over it. This works fine (see 'test file') but the problem is;
when this menu is loaded in a frame (with a limited width) the menu
slides underneath the other (on the right hand) frame. How do I get
this script displaying the menu over the other frame?




"underneath the other": I don't think so.

The menue is clipped in its frame, like all javascript frame effects.

If you do not like that, do not use frames.
 
I

Ikke

Evertjan. said:
Ikke wrote on 10 nov 2003 in comp.lang.javascript:



"underneath the other": I don't think so.

The menue is clipped in its frame, like all javascript frame effects.
Well, I've seen some pop-up 'things' that didn't mind if there's a frame or
not. I believe they just make a sort of new window, displaying it on top of
all the other windows (and frames). So does anybody have an idea how to make
a script like that?
If you do not like that, do not use frames.
But I like frames, I just love it... ;-)


Ikke
 
E

Evertjan.

Ikke wrote on 12 nov 2003 in comp.lang.javascript:
Well, I've seen some pop-up 'things' that didn't mind if there's a
frame or not. I believe they just make a sort of new window,
displaying it on top of all the other windows (and frames). So does
anybody have an idea how to make a script like that?

Beste Ikke uit Tilburg,

That does not mean the clipping is not what happens in stead of the going
"under" another frame [in technical terms it is nearly the same].

Of course you can make new windows but as they can only be placed on a
fixed place on the screen, and not reletive to the old window, I don't
call that a menu anymore.

I suppose that you mistook a cleaverly made css-noframes-page for a frame
page. If I am wrong please give us the URL and we can view-source what's
happening.
But I like frames, I just love it... ;-)

Then this could be the first time you see the "beperkingen" of an
outdated technique.
 
I

Ikke

Evertjan. said:
Ikke wrote on 12 nov 2003 in comp.lang.javascript:
Well, I've seen some pop-up 'things' that didn't mind if there's a
frame or not. I believe they just make a sort of new window,
displaying it on top of all the other windows (and frames). So does
anybody have an idea how to make a script like that?

Beste Ikke uit Tilburg,

That does not mean the clipping is not what happens in stead of the going
"under" another frame [in technical terms it is nearly the same].

Of course you can make new windows but as they can only be placed on a
fixed place on the screen, and not reletive to the old window, I don't
call that a menu anymore.

I suppose that you mistook a cleaverly made css-noframes-page for a frame
page. If I am wrong please give us the URL and we can view-source what's
happening.
But I like frames, I just love it... ;-)

Then this could be the first time you see the "beperkingen" of an
outdated technique.
Mmm... It's always the same. When I "know" a technique, it's already
outdated... So by the time that I understand JavaScript it's probably also
outdated ;-)

But I've found a page on
[http://beta.experts-exchange.com/Web/Web_Languages/Q_20710382.html] where
there's a kind of solution. It's someone with the same sort of problem like
me... see Q&A below.
But I can't figure out how to modify it to use it with 'my own' script,
because my fist script uses a <span onmouseover="..." onmouseout="..."> with
a table</span> and I can't get this script to function the same. How can I
use the popup property from this script to work in my own?

please help... Thanks,

Ikke



----- Q -----
Title: Trying to show content OVER a frame
Author: michmpv
Date: 08/14/2003 11:48PM PDT

i have a html which contains two frames, left and main. i want to create a
mouseover layer on the left menu, and the layer slide over the "main" frame.
But i discovered that the layer cannot display over the frame.
Please help with examples.....

thx
michael

----- A -----
Accepted Answer from msa2003
Date: 08/15/2003 01:30AM PDT

Yes, layer could not display over the frame structure, so, they are two
available solutions:

1. Only under MS IE5.0+: use popup window for layer:

2. If you wont it to slide over the "main" frame only you could use
cross-frame coding:

The following sample shows the both solutions:

---- frameset.html ----

<html>
<head>
<title>Sample layer</title>
</head>
<frameset cols="200,*">
<frame src="left.html" name="left">
<frame src="main.html" name="main">
</frameset>
</html>

---- left.html ----

<html>
<head>
<script>
var popup = window.createPopup();
var htm = '<div style="background-color: silver; color: white; width: 200;
height: 50; text-align: center;">Sample layer</div>';
popup.document.body.innerHTML=htm;
var timer,pLeft,pTop;

function movePopup()
{
popup.show((pLeft+=4),pTop,200,50);
}

function showPopup()
{
popup.show((pLeft=window.screenLeft+100), (pTop=window.screenTop+100), 200,
50);
timer=setInterval('movePopup();',100);
}

function hidePopup()
{
clearInterval(timer);
popup.hide();
}

var layer, lLeft;

function moveLayer()
{
layer.style.left=(lLeft+=4)+' px';
}

function showLayer()
{
layer=window.top.frames['main'].document.getElementById('layer1');
layer.style.visibility='visible';
layer.style.left=(lLeft=100)+' px';
timer=setInterval('moveLayer();',100);
}

function hideLayer()
{
if (layer) {
layer.style.visibility='hidden';
clearInterval(timer);
}
}
</script>
</head>
<body>
<div onmouseover="showPopup();" onmouseout="hidePopup();"><u>Popup window
(IE only)</u></div><br>
<div onmouseover="showLayer();" onmouseout="hideLayer();"><u>Cross-frame
layer</u></div>
</body>
</html>

---- main.html ----

<html>
<body>
<div id="layer1" style="visibility: hidden; position: absolute; top: 100;
left: 100; width: 200; height: 50; background-color: silver; color: white;
text-align: center;">Sample layer</div>
Main
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top