Could someone help me with this code

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Acceptable Use

I noticed the .this.style.backgroundcolor="""" but I dont understand why there are three periods. This is from the site webmasterforums.com

ALso, I noticed from their code that they use a javascript method of making their menu at the top from this code

<script TYPE="text/javascript" LANGUAGE="javascript" SRC="/include/loadmenu.js"></script>

Are there any good resources to learn how to make javascript menu's. Is an advantage of using them loading time, and browser compatibility?

Sorry for the multiple questions

Bryan

pmj7's picture

He has: 234 posts

Joined: Nov 2002

Is webmasterforums.com a typo? Neither this site, nor the one you list has the code you describe. '"' are called quotes, not periods.

I'd suggest you visit http://www.irt.org and read up on JavaScript, they probably have something on menus there. You should never rely on JavaScript to do something, because a visitor's browser might not support it or even have it turned off. The one advantage of using JavaScript to create your navigation is that you can update it by changing a single file. If you don't have server support (PHP, etc), then this is the only way it can be done without frames.

Peter

Touchup image processing applet
Pixel Development Web Design, Photography

dk01's picture

He has: 516 posts

Joined: Mar 2002

.this.style.backgroundcolor=""

should actually be

this.style.backgroundcolor="";

"this" - the current element on the page, in your case its a tr.
"style" - the object of style refers to the css properties of the element "this". So "this.style" gets all of the css properties of the element .
"backgroundColor" this is the property of the background color.

The periods between all the objects just show that you are becoming more specific. (Starting off with all the properties of the object -> going to just the css properties -> going to just the backgroundColor css property.

Hope that helps. Sorry its not so clear.

-dk

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Quote: Originally posted by pmj7
Is webmasterforums.com a typo? Neither this site, nor the one you list has the code you describe. '"' are called quotes, not periods.

Peter, I'm surprised at your response...

He was referring to the periods, not the quotation marks.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Thanks, that clears a few things up.

Bryan

They have: 8 posts

Joined: Dec 2002

Quote: Originally posted by Suzanne
Peter, I'm surprised at your response...

He was referring to the periods, not the quotation marks.

I agree - and the webmasterforums.com does indeed have that code, it's for the side navigation and it changes the background color of each link onmouseover. Such a thing could be handled in CSS rather than javascript, but to each his own.

Tiffany

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.