Rajarshi Guha

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromRajarshi Guha
ToMe
Subjectusing CSS menus inside a frame
Date1 April 2004 05:14
Hi,
I've been fiddling with the CSS menu code that you've described at
http://www.howtocreate.co.uk/tutorials/testMenu.html.

Thanks for the neat snippet. However I face a problem when I try to use
it in a frame based design. You can see the example at

http://xx.xxxx.xxx.xxx/xxxxxxxxx/testing/index.php

Is there any way to make the submenus display on top rather than being
chopped of by the frame edge? Is this a job for layers - if so could you
give me a pointer as to how I could achieve it?

Thanks
FromMe
ToRajarshi Guha
SubjectRe: using CSS menus inside a frame
Date1 April 2004 08:25
Rajarshi,

Frames are a sort of window, and just like a window, content cannot extend
beyond the edge of the frame. The only way to do that is to have the layers
inside the other frame and to control them from the first.
Sorry, but there is absolutely no way that CSS can be used to affect one
frame from another, this can only be done with JavaScript. I have not yet
written a script to do this, but there are parts of my reference manual
that would describe how to do the various parts of this if you needed to.

My generic referencing function can reference layers inside another frame:
http://www.howtocreate.co.uk/tutorials/javascript/elementcontents

The DHTML section can then be used for showing and hiding menu items using
'visibility':
http://www.howtocreate.co.uk/tutorials/javascript/dhtml

If you wanted to dynamically position them, you could either use event
information:
http://www.howtocreate.co.uk/tutorials/javascript/eventinfo
or you could use the position of the element that triggers showing/hiding:
http://www.howtocreate.co.uk/tutorials/javascript/browserspecific (see
'simple example' - the technique works for all elements in all browsers
except Netscape 4)

The layer would need to detect when the mouse moved over/off it to
determine when to show/hide, and you would need a delay to allow your
mouse the time to move from one frame to another:
http://www.howtocreate.co.uk/tutorials/javascript/timers

I guess you can see why I have not written a script to do this yet :)

Good luck.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.