M
Mike Barnard
Hi again.
[For those of you that think PHP is off topic, sorry, but this has
been the best forum for help I have found so far and I have been
invited to continue to discuss this subject here.]
Bootnic offered me a simple PHP menu include which is fantastic.
Thanks again. I have been trying to improve on it by adding a second
level of menus. However, I am very new to PHP and I can't decide on
which is the best methodology to do it.
Obviously, the PHP script is only processed when the page is requested
from the server. Therefore, in order to have a second level of menus
show when a user hovers over a first level menu item, the browser has
to do the work in showing it. This removes PHP itself from the agenda
at this stage.
Javascript would be one way I'm sure and there are loads of such
systems available for use. But I don't trust that all browserss will
have JS running so I wish to rely on PHP, HTML and CSS.
The only way I can think of for a second ( or more?) level to work
with these restrictions is for the menus for *ALL* levels to be
created by the PHP script when the page is called, but the CSS
properties of the unwanted lists be set such that they can't be seen.
Maybe by absolute positioning, sending them off screen until a hover
changes thier locations, or by setting thier colours to transparent or
something, or maybe using Z indexs to hide them under the rest. Or
something else?
I do not want to reinvent the wheel. I wonder if someone can help by
explaining the most efficient methodology, and why it is. I'm happy to
try and create my own scripts, I do not expect it to be handed to me
on a plate, but I do not have enough knowledge and experience to get
the best from this without some advice. If anyone would like to take
the time to comment (nicely!) I would really apprecieate it.
Thanks, again.
Mike.
[For those of you that think PHP is off topic, sorry, but this has
been the best forum for help I have found so far and I have been
invited to continue to discuss this subject here.]
Bootnic offered me a simple PHP menu include which is fantastic.
Thanks again. I have been trying to improve on it by adding a second
level of menus. However, I am very new to PHP and I can't decide on
which is the best methodology to do it.
Obviously, the PHP script is only processed when the page is requested
from the server. Therefore, in order to have a second level of menus
show when a user hovers over a first level menu item, the browser has
to do the work in showing it. This removes PHP itself from the agenda
at this stage.
Javascript would be one way I'm sure and there are loads of such
systems available for use. But I don't trust that all browserss will
have JS running so I wish to rely on PHP, HTML and CSS.
The only way I can think of for a second ( or more?) level to work
with these restrictions is for the menus for *ALL* levels to be
created by the PHP script when the page is called, but the CSS
properties of the unwanted lists be set such that they can't be seen.
Maybe by absolute positioning, sending them off screen until a hover
changes thier locations, or by setting thier colours to transparent or
something, or maybe using Z indexs to hide them under the rest. Or
something else?
I do not want to reinvent the wheel. I wonder if someone can help by
explaining the most efficient methodology, and why it is. I'm happy to
try and create my own scripts, I do not expect it to be handed to me
on a plate, but I do not have enough knowledge and experience to get
the best from this without some advice. If anyone would like to take
the time to comment (nicely!) I would really apprecieate it.
Thanks, again.
Mike.