Forum Moderators: open
Check out this thread for one approach, and to get a deeper idea of how this kind of menu works:
[webmasterworld.com...]
You are welcome to share the instructions here in the thread.
Once you make a few menu's you will see how customizable this is. you will need to experiment with it bit. You can even make sub menu sliders it you want. This only works in FrontPage and these instructions apply to FP2003. It looks like a lot of steps, but once you've done it a few times and understand what's happening it will take only minutes to set up. This also works in toolbars, shared borders and include files.
so here's the instructions.
open up your webpage
type the word "menu", put it in a font tag, not a <P> tag
On the top toolbar
click on INSERT/LAYER, a layer appears on the page
click on FORMAT/LAYER, the layer pane appears
now highlight the word "menu", your going to set up the action that makes the layer appear and disappear
click on behavior at the bottom of layers pane (or from the dropdown on the layers pane)
click INSERT/CHANGE PROPERTY/SELECT ELEMENT (div, layer 1 should be active)
click VISIBILITY
click VISIBLE/OK/RESTORE ON MOUSE OUT EVENT/OK
On the behaviors pane you should have
OnMouseOut Change Property Restore
OnMouseOver Change Property
now you need to set up the layer
click on the layer to select it, the drag handles should appear.
click on the layers link at the bottom of the behaviors pane
click on Borders and Shadings
click on the shading tab
click on Background and pick a color
click OK
In the layer type; Link 1 then press enter, Link2 then press enter, Link3 then press enter
Pick what ever font style and color you want for the links, just make sure you set each link separately.
My layer had a blue background so I went with bold white text.
Now to select the behaviors for the layer;
click on INSERT/CHANGE PROPERTY/SELECT ELEMENT (div, layer 1 should be active)
click on VISIBILITY, VISIBLE/OK/OK (FP tries to make decisions for you and here it will probably make a wrong one. change it event to OnMouseOver)
Do Not select Restore On Mouse Out
Make sure the layer is still selected
Click on INSERT/CHANGE PROPERTY/SELECT ELEMENT (div, layer 1 should be active)
Click VISIBILITY/HIDDEN/OK/OK (do not select restore on mouse out) Make sure your event is OnMouseOut
OnMouseOut Change Property
OnMouseOver Change Property
Go to preview mode and test the mouse over. The layer should appear when your hover the mouse over the word menu and the layer
should disappear when you move the mouse off the word.
If it doesn't go back to design mode, in the layer pane make sure the little eye to the left of the layer is closed and try again.
Now to make the links and mouse over in the layer.
select the layer ( make sure you have drag handles)
drag the mouse over link1 to make the On Hover color.
On the behaviors pane go to INSERT/CHANGE PROPERTY/CURRENT ELEMENT
element type will be font (or a similar font tag like <B> ) element will be no ID, one will be generated
Click on Borders, under style select one, under the shading tab background/color/select color, I chose red then OK/OK
If it created the wrong event change it manually to OnMouseOver.
Then INSERT/CHANGE PROPERTY/CURRENT ELEMENT (type will be font and element ID will be ID1)
Click on BORDERS, under STYLE select NONE, under SHADING/BACKGROUND COLOR/ select blue (if that was the original background color) /OK/OK
Make sure it created an OnMouseOut event, if not, change it manually
On the behaviors pane click INSERT/GO TO URL/ ENTER THE URL and make sure the event is OnClick.
Repeat for Link2 and Link3
You should have these events when your done.
OnClick Goto URL
OnMouseOut Change Restore
OnMouseOver Change Property
When your done make sure you place the layer over the word menu, set the eye in the layers pane to closed and set positioning to absolute positioning.
I may have missed a step in typing this out, but it works and its highly customizable. You can even nest layers and menus.
Mike, can you tell us how the code created with your approach stacks up cross browser and with W3C validation?
It looks like SuckerFish is about the best, most efficient, and relatively simple way to do it. Yes? No?
Yeah, I've used it more than once. As have friends. It's solidly cross-browser and platform. And is pure CSS except for the few lines of Javascript necessary to get that clunky Internet Explorer working right. It's also all valid code and degrades well, so it won't mess with your SEO or cause accessibility issues as long as you have sub-pages for each section with links.
This is the code in the <head> tag
<script language="JavaScript">
<!--
function FP_changeProp() {//v1.0
var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o";
ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) {
s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
if(s) eval(s+"=v"); }
}
function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id ¦¦ o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
function FP_changePropRestore() {//v1.0
var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}
function FP_goToURL(url) {//v1.0
window.location=url;
}
// -->
</script>
and this is the code on the page
<font face="Verdana" size="2" onmouseout="FP_changePropRestore()" onmouseover="FP_changeProp(/*id*/'layer1',1,'style.visibility','visible')">
menu</font>
<div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 22px; top: 22px; visibility: hidden; background-color: #0000FF" id="layer1" onmouseover="FP_changeProp(/*id*/'layer1',0,'style.visibility','inherit')" onmouseout="FP_changeProp(/*id*/'layer1',0,'style.visibility','hidden')">
<font color="#FFFFFF">
<b id="id1" onmouseover="FP_changeProp(/*id*/'id1',0,'style.backgroundColor','#00FFFF');" onmouseout="FP_changeProp(/*id*/'id1',0,'style.backgroundColor','#0000FF')" onclick="FP_goToURL(/*href*/'www.awebsite.com')">
link1</b></font><p><b>
<font color="#FFFFFF" id="id2" onmouseover="FP_changeProp(/*id*/'id2',0,'style.backgroundColor','#00FFFF');" onmouseout="FP_changeProp(/*id*/'id2',0,'style.backgroundColor','#0000FF')" onclick="FP_goToURL(/*href*/'www.awebsite.com')">
link2</font></b></p>
<p><b>
<font color="#FFFFFF" id="id3" onmouseover="FP_changeProp(/*id*/'id3',0,'style.backgroundColor','#00FFFF');" onmouseout="FP_changeProp(/*id*/'id3',0,'style.backgroundColor','#0000FF')" onclick="FP_goToURL(/*href*/'www.awebsite.com')">
link3</font></b></div>