PDA

View Full Version : ONLOAD and a simple menu


gyonis
09-20-2005, 08:20 AM
Hi,

Can I have two ONLOAD functions on the body tags, I already have one for image preloading, and I want to add another for menu script, I tried adding to ONLOAD (ONLOAD="preloadImages()"; ONLOAD="menu()";), but non of them worked.
And does any body have a simple, easy to install menu script that does not conflict with the preloading script, I have and image buttons, I want when mouse over a menu will appear containing links, that simple.


Ghassan

maskd
09-20-2005, 08:24 AM
Well you could create a function that calls both functions.


function loadfuncs()
{
preloadImages();
menu();
}


And then call that function with body onload.


<body onload="loadfuncs()">


I'm sorry but I can't help you with your Dynamic Menu question.

RysChwith
09-20-2005, 08:41 AM
You can do it this way:<body onload = "preloadImages(); menu()">My usual recommendation for menus is this:

http://www.alistapart.com/articles/dropdowns

Although it requires a fair understanding of CSS.

Rys

gyonis
09-20-2005, 09:31 AM
"<body onload = "preloadImages(); menu()">"

I did that, now the preloader work, but the menu script doesn't, and the page is all screwed up, the text alignment, the table width ..., you can see the code here:
http://www.digitalmedia-sol.com/jedco/

gyonis
09-20-2005, 09:33 AM
... the menu should be on the about button

gyonis
09-20-2005, 11:23 AM
And this what happens if I only keep the menu script:

http://www.digitalmedia-sol.com/jedco/index2.html

Can somebody help me please, I've been searching and trying different menu script for three days and nothing works, keep in mind that I don't want a script that create menu from scratch, I already have an image buttons that I want a menu to appear when mouse over them.

If you can help please ASAP, the deadline only one day away.

Ghassan

RysChwith
09-20-2005, 01:27 PM
Part of the problem may be that you keep putting the semicolon outside of the quotation marks. This is incorrect:onmouseover = "small( 'about' )";This is correct:onmouseover = "small( 'about' );"The problem could also be any of the 41 errors the validator is reporting:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.digitalmedia-sol.com%2Fjedco%2F

Tough to say beyond that.

Rys

gyonis
09-21-2005, 06:38 AM
1st sorry for the delay (GMT +3), 2nd, thanx for the help, I did change it:
http://www.digitalmedia-sol.com/jedco/index3.htmlbut still, can some one please point me to a good simple menu script. All the script I found searching do menus from scratch, including the titles not just the sub-titles, as you can see from the link, I have a vertical navigation bar made of images as button, what I need is simply, when a mouse is over an image (like the about button), a menu with the sub-titles appear.

Ghassan

coothead
09-21-2005, 11:33 AM
Hi there gyonis,

check out the attachment, it is your code validated and script errors removed. :D

gyonis
09-23-2005, 08:51 PM
That's amazing, you’re really a life saver, but there’s also couple of things that I want to ask you about:
1st. you removed the onfocus script for the newsletter test box, why, was affecting the other scripts.
2. You removed the link to the CSS file, and remove the style:
"style="position:absolute; width:100; height:97; z-index:1; left: 129; top: 170; background-color: #009900; layer-background-color: #009900; border: 1px none #cccccc" "
from the div tag, can't I return the style linking, and add the div style to the css file.
and if I removed the link to the css the text problem appear, in IE 5 it's fine, in 6 it's all screwed up, the alignment suppose to be to the left, but the text lines are in various directions!

So my questions is:
- Can I use other scripts without having a conflict with the menu script? and can I put them all in one big happy js file with no fear that something might come wrong?
- Can I link to the css file and add the "#about" style to it?

I think I should study more css and js and the actual coding rather on just focusing on the design concepts and usability.

Thanx again coothead, sorry for the questions, but I don't want to screw things up, I want it to be 100% perfect.

Ghassan

coothead
09-24-2005, 05:57 AM
Hi there gyonis,

I am pleased that your life is no longer in danger. :D

1st. you removed the onfocus script for the newsletter test box, why? was it affecting the other scripts?
2nd. You removed the link to the CSS file,

I did not remove these items. What has happened is that the code that I worked on was found at the link
that you provided in your second post to this thread. That code had neither of the items that you mentioned. :supereek:
Not to worry, though, I have put them in the new attachment. :)

1. Can I use other scripts without having a conflict with the menu script?
2. And can I put them all in one big happy js file with no fear that something might come wrong?

1. yes.
2. probably.

Can I link to the css file and add the "#about" style to it?

I have, as stated above, put the link in. All you need to do is place the extra rules that I have added to your code....

body {
margin:0px;
padding:0px;
}
#about {
position:absolute;
width:131px;
z-index:1;
left:131px;
top:173px;
background-color: #fc3;
}
form {
margin:0px;
}

...into your external stylesheet and remove my code from the page.

gyonis
09-24-2005, 08:57 AM
You're a great man :thumbup: , are you really a postman =:O , if you were, you should think about quieting your day job, your expertise are needed else where

Thanx again

coothead
09-24-2005, 09:09 AM
Hi there gyonis,
....are you really a postman =:O
Yes that's what I do for a living....problem solving I do for fun and for free. :)