Click to See Complete Forum and Search --> : positioning java menu


crashdaraven
03-08-2003, 12:40 AM
Hi everyone, i have a problem positionng a java menu in my page.
The menu looks good wen i vieuw Full Screen than hit refresh button.

i can chance cooirdinates whitin nwrmenu.js to position it right in full screen browser browser but wen going to normal browser vieuw then the menu looks not good anymore.

i want the menu to chance cooirdinates wen using a different browser size.
So that its always on the right place.
nomather wen its full screen or other size.


Can this be than whith this menu ?

Hope anyone can help me with this.

crashdaraven
03-08-2003, 10:18 AM
Uuuh

Sorry im an absolute script dummy :-)

Do i put that code in the html or in the schript?

crashdaraven
03-09-2003, 08:17 AM
Am still verry much confuced
i have the following code line.

<body onresize="return someFunc();">

<script src="nwrmenu.js"type=text/javascript></script>
<script src="menu.js"type=text/javascript></script>

most i put the two script code lines between () from the html tag ?

khaki
03-09-2003, 12:45 PM
Hi Crash....

That menu also allows you to position it within a <div> or <span> tag as wll as with specified x and y coordinates.

In the nwrmenu.js file there is a line that says this:
var TargetLoc='';

Just put the ID name of the <div> or <span> tag as the TargetLoc and it will give you greater flexixbilty for positioning it on your page.

I really don't understand why the issue of resizing the browser window would be one to program for (do people really resize windows once they open them? I never really consider that myself. Maybe I should?).

I think that the best way to control the placement of that menu is to create and control a container that holds it. Dave gave you the event for firing a function that detects that action, so you may be able to combine that with the positioning of the <div> or <span> that contains the menu (since the menu itself is not very editable for a self-described "script dummy" to undertake).

Hopefully that was more helpful than confusing (I can be both at times, I'm afraid. wink)
k

khaki
03-09-2003, 10:57 PM
ok, so I was trying to get this menu (bold) to work with onload and onresize
for Crash, and it's buggier than i thought it would be.

I can get it to position properly without enclosing it in a function (green), so I
know that the concept and element target ("IDname") part is working.

But it keeps crapping-out when it is part of an onLoad function (red)... or any
function at all actually.
So it works one way... but not the other. Ugh!

I'm sure that we all know that I understand just enough javascript to get myself
into trouble - but not enough to get myself out of it, so can anyone figure out
what my problem is?
The original external JS file (nwrmenu.js) had to be modified to work with an
element ID target, so I can't point you to a working version on the web. I can
attach a copy of it here if I need to though.
Anyone?
thanks as always everyone...
k

---this works---
<HTML>
<HEAD>
<script language=javascript>
scrW = (screen.width - 500) / 2 ;
</script>
</HEAD>
<BODY>
<script language=javascript>document.write('<div id="IDname" style="position:absolute; left:' + scrW + 'px; top:70px;">')</script>
<script type="text/javascript" src="nwrmenu.js"></script>
<script type="text/javascript" src="http://javascript.internet.com/navigation/menu_com.js"></script>
<script language=javascript>document.write('</div>')</script>
</BODY>
</HTML>

---this doesn't---
<HTML>
<HEAD>
<script language=javascript>
function menuPos()
{
var scrW = (screen.width - 600) / 2 ;
document.write('<div id="IDname" style="position:absolute; left:' + scrW + 'px; top:70px;">');
document.write('</div>');
// this part creates the element ("IDname") container for the menu to target
}
</script>
</HEAD>
<BODY onload="menuPos()">
<script type="text/javascript" src="nwrmenu.js"></script>
<script type="text/javascript" src="http://javascript.internet.com/navigation/menu_com.js"></script>
</BODY>
</HTML>

khaki
03-09-2003, 11:37 PM
Are you sure that you don't want to take more than 15 seconds to answer that Dave (lol).

Wow. To think I have spent about 3+ hours on this, and you responded within minutes (and it works! of course).

I didn't realize that I could attach so much javascript code to the event itself. And the getElementById part has now surfaced as answers to my last 2 questions.... so I better get comfortable with that part real quick, I guess.

Thanks so much Dave (as always).
OK Crash...payin' attention? Now we both know how to do this!

now able to have sweet (no code) dreams. a sleepy...
k

crashdaraven
04-11-2003, 01:54 AM
Sorry for the verry late answer.
Dunno what i do wrong, but it doesnt work by me.
I think im gonna give up this menu thingy.
Its excatley what i whant but it drive`s me crazy to positioning it.
Can any one of you attach a working copy to a reply, so i can examen it how it works by you guys.

Thank for all your input guys.

Nevermore
04-11-2003, 08:05 AM
If you post your code (none working), I'm sure we can fix it.

crashdaraven
04-13-2003, 04:21 AM
Ok here it is, thanx in advange