This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > vertical flyout menu and left justification





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author vertical flyout menu and left justification
pleaseno

2004-08-23, 7:16 pm

I am attempting to create a vertical flyout menu on my own. I have it
working well, except when I resize my browser, then the positioning
gets messed up.

For the vertical flyouts to work properly does the site have to be
left justified? My site is centered and I am trying to determine if I
need to change the design if I want to go with the flyouts.

Thanks.
Osgood

2004-08-23, 7:16 pm

pleaseno wrote:
> I am attempting to create a vertical flyout menu on my own. I have it
> working well, except when I resize my browser, then the positioning
> gets messed up.
>
> For the vertical flyouts to work properly does the site have to be
> left justified? My site is centered and I am trying to determine if I
> need to change the design if I want to go with the flyouts.
>
> Thanks.


Go here, www.projectseven.com and look at the tutorials for positioned
menus.

'Snap layers' is the extention that you need, its free to download from
the extentions page on that site.

pleaseno

2004-08-23, 7:16 pm

Thanks Osgood.

I am attempting to do this without the use of extensions. If there a
place you can recommend where I could see the code for this working
properly, specically the part where I want the postion to stay.

Thanks.


On Mon, 23 Aug 2004 17:19:26 +0100, Osgood
<notavailable@atthisaddress.com> wrote:

>pleaseno wrote:
>
>Go here, www.projectseven.com and look at the tutorials for positioned
>menus.
>
>'Snap layers' is the extention that you need, its free to download from
>the extentions page on that site.


Murray *TMM*

2004-08-23, 7:16 pm

If you want it to work without using extensions, then you will have to use
CSS.

Here is a good demonstration -

http://www.roast-horse.com/tutorial...tent/index.html

And here is some code -

(inline styles used for clarity)

STYLESHEET -
body { text-align:center; } /* for IE5/IE5.5 */
#wrapper { text-align:left; }

BODY -
<div id="wrapper" style="width:760px; top:0; margin:0 auto;
position:relative;">
<div id="layer1" style="width:200px; top: 25px; left:140px;
position:absolute;">blah</div>
<div id="layer2" style="width:180px; top: 136px; left:23px;
position:absolute;">blah</div>
</div>

Try that - an outer relatively positioned division with a width and auto
left and right margins. All interior AP divisions will be centered, yet
retain the
same relative positioning. These would be your menu and its submenus.


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"pleaseno" <pleasenoemail@ohno.com> wrote in message
news:412a1e04.8839531@forums.macromedia.com...
> Thanks Osgood.
>
> I am attempting to do this without the use of extensions. If there a
> place you can recommend where I could see the code for this working
> properly, specically the part where I want the postion to stay.
>
> Thanks.
>
>
> On Mon, 23 Aug 2004 17:19:26 +0100, Osgood
> <notavailable@atthisaddress.com> wrote:
>
>



Osgood

2004-08-23, 7:16 pm

pleaseno wrote:

> Thanks Osgood.
>
> I am attempting to do this without the use of extensions. If there a
> place you can recommend where I could see the code for this working
> properly, specically the part where I want the postion to stay.



I dont think there is a specific page which will show you how this is
achieved when using flyout menus. Murray has given you a general page
which should help you along.

What you will have to do is house your text links in their own <divs>
which have a positioning of relative. Within these relative <divs> you
can insert absolutely position <divs> or other relatively positioned <divs>

The nested <divs>, either absolutely positioned or relatively positioned
will move when the main structure of the page moves in accordance with
the widening or narrowing of the browser window.


You can insert relatively positioned <divs> inside of table cells if you
are using a table construction to bulit the main framework of your page.

Osgood

2004-08-23, 7:16 pm

Osgood wrote:


> I dont think there is a specific page which will show you how this is
> achieved when using flyout menus.


Cut the code below, paste into a new DW document. It might give you some
idea of how this works.

It still uses the auto and auto hide layers extentions from PV11 but no
snapping.

Im not sure you will be able to get something to work cross browser if
you are just trying to use pure css.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style>
body {
font-family: arial, verdana, helvetica;
font-size: 12px;
color: #fff;
}
a {
display:block;
color: #fff;
text-decoration: none;
border-bottom: 1px solid #fff;
padding: 4px 0 4px 6px;
}
#navholder {
width: 150px;
margin: 0 auto;
}
#linkone, #linktwo, #linkthree, #linkfour {
background-color: #000;
color: #fff;
position: relative;
}
#subone, #subtwo, #subthree, #subfour {
background-color: #ab1;
color: #fff;
position: absolute;
top: 0;
left: 150px;
width: 150px;
visibility: hidden;
padding: 4px 0 4px 6px;
}
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_autoLayers() { //v1.4 by PVII
var
g,b,k,f,args=P7_autoLayers.arguments;a=parseInt(args[0]);if(isNaN(a))a=0;
if(!document.p7setc){p7c=new Array();document.p7setc=true;for(var
u=0;u<10;u++){
p7c[u]=new
Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){

b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++){

if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="visible";f=false;
for(var j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}

function P7_hideDiv(evt) { //v1.3 by PVII
var b,relT,mT=false;
if(document.layers){b=evt.target;if(b.p7aHide){
b.visibility="hidden";}else{routeEvent(evt);}
}else if(document.all&&!window.opera){b=event.srcElement;
while(b!=null){if(b.tagName=="DIV" &&
b.p7ahD){mT=true;break;}b=b.parentElement;}
if(!b.contains(event.toElement)){b.style.visibility="hidden";}
}else
if(document.getElementById){b=evt.currentTarget;relT=evt.relatedTarget;
while(relT!=null){if(b==relT){mT=true;break;}
relT=relT.parentNode;}if(!mT){b.style.visibility="hidden";}}
}

function P7_autoHide() { //v1.3 by PVII
var i,g,args=P7_autoHide.arguments;
for(i=0;i<args.length;i++){if((g=MM_findObj(args[i]))!=null){
g.p7aHide=true;if(document.layers){
g.captureEvents(Event.MOUSEOUT);}g.onmouseout=P7_hideDiv;g.p7ahD=true;}}
}
//-->
</script>
<!--[if IE 6]>

<style>
a {height: 1em;}
</style>

<![endif]-->
</head>

<body onLoad="P7_autoHide('subone','subtwo','subthree','subfour')">
<div id="navholder">
<div id="linkone"><a href="java script:;"
onMouseOver="P7_autoLayers(0,'subone')">Link One</a>
<div id="subone">Go to page 1</div>
</div>
<div id="linktwo"><a href="java script:;"
onMouseOver="P7_autoLayers(0,'subtwo')">Link Two</a><div id="subtwo">Go
to page 2</div>
</div>
<div id="linkthree"><a href="java script:;"
onMouseOver="P7_autoLayers(0,'subthree')">Link Three</a><div
id="subthree">Go to page 3</div>
</div>
<div id="linkfour"><a href="java script:;"
onMouseOver="P7_autoLayers(0,'subfour')">Link Four</a><div
id="subfour">Go to page 4</div>
</div>
</div>
</body>
</html>


Osgood

2004-08-23, 7:16 pm

Not sure this post got through last time (I'm getting the 'too many
files open message', which usually means the MM server is on the blink)

I'll try again.


ooooops forgot about IE.

For PC IE you need to add text-align: center; to the 'body' css style
and text-align: left; to the 'navholder' style, other wise the nav will
sit over to the left of the page and go absolutely nowhere.

pleaseno

2004-08-23, 7:16 pm

Thanks a lot guys. I will give this all a try.

On Mon, 23 Aug 2004 19:16:50 +0100, Osgood
<notavailable@atthisaddress.com> wrote:

>Not sure this post got through last time (I'm getting the 'too many
>files open message', which usually means the MM server is on the blink)
>
>I'll try again.
>
>
>ooooops forgot about IE.
>
>For PC IE you need to add text-align: center; to the 'body' css style
>and text-align: left; to the 'navholder' style, other wise the nav will
>sit over to the left of the page and go absolutely nowhere.


Osgood

2004-08-24, 7:14 am


ooooops forgot about IE.

For PC IE you need to add text-align: center; to the 'body' css style
and text-align: left; to the 'navholder' style, other wise the nav will
sit over to the left of the page and go absolutely nowhere.

Osgood

2004-08-24, 7:14 am

Not sure this post got through last time (I'm getting the 'too many
files open message', which usually means the MM server is on the blink)

I'll try again.


ooooops forgot about IE.

For PC IE you need to add text-align: center; to the 'body' css style
and text-align: left; to the 'navholder' style, other wise the nav will
sit over to the left of the page and go absolutely nowhere.

Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews