PDA

View Full Version : MouseOver Script



HGO-webmaster
12-12-2005, 04:29 PM
Hello

I like those Mouseover Menu's/Navigations so I decided to take one on my site. But now I have a bit of a problem because the HTML script is like this: submenu[0]='<font size="2" face="Verdana"><b><a href="http://www.javascriptkit.com/cutpastejava.shtml">Scripts</a> | <a href="http://www.javascriptkit.com/javaindex.shtml">JS tutorials</a> | <a href="http://www.javascriptkit.com/javatutors/index.shtml">Advanced JS tutorials</a> | <a href="http://www.javascriptkit.com/java/">Applets</a> | <a href="http://www.javascriptkit.com/howto/">Web Tutorials</a></b></font>'. That meens that the title is JavaScript Kit. But I'd like to have a button(self made picture) instead of the text JavaScript. Can anyone help me, because I have no Idea how to do it. If you want to see it Click Here (http://www.dynamicdrive.com/dynamicindex1/tabmouseover.htm)

I Hope anyone can help me
Thank you
Sanne

jscheuer1
12-13-2005, 06:50 AM
Actually, here (highlighted red) is where it means that the title (header) will be 'JavaScript Kit':


<a href="http://www.javascriptkit.com" onMouseover="showit(0)">JavaScript Kit</a> | <a href="http://freewarejava.com" onMouseover="showit(1)">Freewarejava</a><br>

To use an image instead, replace it with an image tag for your "self made picture":


<a href="http://www.javascriptkit.com" onMouseover="showit(0)"><img src="my_header_01.gif" border="0"></a> | <a href="http://freewarejava.com" onMouseover="showit(1)">Freewarejava</a><br>

HGO-webmaster
12-13-2005, 06:34 PM
Thank you so much, I'm just a beginner so I had no idea what to do....But thank you....

Sanne

Twey
12-13-2005, 06:58 PM
I don't know why, but I just utterly cracked up over the "self made picture."

HGO-webmaster
12-14-2005, 03:25 PM
Well, I made it, bur well because I'm a unknowing and very young beginner.. Where do I have to place it all?????...I really haven't got a clue!

Sanne

jscheuer1
12-14-2005, 04:59 PM
Don't take Twey's comment personally. I found the phrase:

self made picture

amusing too. I think it is because it resembles this phrase:

self made man

and when thought of that way, conjures an image of an image creating itself. Somewhat like the sound of one hand clapping.

Twey
12-14-2005, 05:31 PM
The sound of one hand clapping is not, contrary to popular belief, "cl." It is, quite obviously if you think about it, "ap."

HGO-webmaster
12-14-2005, 07:40 PM
I didn't know how to say it, I'm just an 13 year old Dutch GIrl :o :D

Twey
12-14-2005, 07:47 PM
Lol, don't worry about it; it's fine :)
Even I still don't know exactly what I found so funny about that particular phrase :p
Your English is actually quite a lot better than some English (and American) people I've seen here :)

HGO-webmaster
12-14-2005, 07:53 PM
Well Thank you, Bytheway I have to get used to the fact that I'm 14 yeah, but where do I have to place the menu???

Can you help me??

jscheuer1
12-15-2005, 08:00 AM
but where do I have to place the menu???

I thought you already had that under control, sorry. The instructions on the demo page are pretty clear:


Just insert the below code into the BODY section of your page where you wish the menu to appear: (code block follows on the demo page)

In case, (and I know it was for me in the beginning of my quest to understand these things) that isn't enough for you -

Every HTML page has (or should have) a body tag (only one per page), it can look as simple as this:


<body>

or there can be a bunch of various things in there, ex:


<body text="white" bgcolor="black" onload="init();">

However it looks, it signals the beginning of the content or visible portion of the page. It continues until (usually near the end of the page) you see a:


</body>

. . . the closing body tag. So, all you need to do is open your HTML file with a text editor and find this region (the area between <body> and </body>), look at what is there, if there is anything, you will recognize stuff that you see when the page is displayed in the browser, if there isn't anything, you have a blank page. Choose a spot in this body region and paste in your code for your menu, save the file and look at the result in your browser.

HGO-webmaster
12-15-2005, 12:00 PM
Thank you. I get it now..
And I hope it will work

HGO-webmaster
12-15-2005, 12:07 PM
Oh, just one question, I was looking at the script and I noticed this piece:

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()

What does it meen and what am I supposed to do with it????
:o :o :o :D

jscheuer1
12-16-2005, 07:44 AM
You aren't supposed to do anything with it. The first part assigns a value to the variable menuobj. What this value is depends upon which browser is being used to view the page. Different browsers use different methods to access an element. Whichever of the the methods listed that a browser 'likes' will be used to assign menuobj the element that has the id of 'describe' or, in the case of NS4, a similar element that it can deal with.

The rest uses similar object detection to determine how best each browser may be instructed to clear away previously displayed transient content from this assigned element and to now display the content being called for through it. And then does so.

HGO-webmaster
12-16-2005, 04:59 PM
Thanks :D