Two scripts interfering with each other

A

Anne Kosmicki

I am definitely a Javascript novice. I am currently redesigning &
rebuilding my company's web site, using CSS & XHTML. I am trying to
build as "light" & compliant a site as possible. To that end, I have
found two CSS & JS solutions to two problems.

The first solution is a pop-down menu script, found here:
http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html

The second solution rounds the corners [nifty corners] on boxes:
http://pro.html.it/articoli/id_599/idcat_31/pro.html

I added the menus to my pages first & got them working with no problem.
However, when adding the nifty corners script links, they didn't work.
The nifty corners script links were listed first in the head. If I
changed the order of the script links in the head [putting the menu
first], the corners would round, but the menus wouldn't work.

My page is here:
http://www.t2000inc.com/test/
[with the menu listed last & working]

My CSS:
http://www.t2000inc.com/test/techcss.css
http://www.t2000inc.com/test/niftyCorners.css

The javascript files:
menu: http://www.t2000inc.com/test/menuDropdown.js
nifty corners: http://www.t2000inc.com/test/nifty.js
& http://www.t2000inc.com/test/corners.js

Please let me know if you need more information or detail. Thanks in
advance for any help!
Anne
 
M

McKirahan

Anne Kosmicki said:
I am definitely a Javascript novice. I am currently redesigning &
rebuilding my company's web site, using CSS & XHTML. I am trying to
build as "light" & compliant a site as possible. To that end, I have
found two CSS & JS solutions to two problems.

The first solution is a pop-down menu script, found here:
http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html

The second solution rounds the corners [nifty corners] on boxes:
http://pro.html.it/articoli/id_599/idcat_31/pro.html

I added the menus to my pages first & got them working with no problem.
However, when adding the nifty corners script links, they didn't work.
The nifty corners script links were listed first in the head. If I
changed the order of the script links in the head [putting the menu
first], the corners would round, but the menus wouldn't work.

My page is here:
http://www.t2000inc.com/test/
[with the menu listed last & working]

My CSS:
http://www.t2000inc.com/test/techcss.css
http://www.t2000inc.com/test/niftyCorners.css

The javascript files:
menu: http://www.t2000inc.com/test/menuDropdown.js
nifty corners: http://www.t2000inc.com/test/nifty.js
& http://www.t2000inc.com/test/corners.js

Please let me know if you need more information or detail. Thanks in
advance for any help!
Anne

And if JavaScript is disabled then no menues!
 
R

RobB

Anne said:
I am definitely a Javascript novice. I am currently redesigning &
rebuilding my company's web site, using CSS & XHTML. I am trying to
build as "light" & compliant a site as possible. To that end, I have
found two CSS & JS solutions to two problems.

The first solution is a pop-down menu script, found here:
http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html

The second solution rounds the corners [nifty corners] on boxes:
http://pro.html.it/articoli/id_599/idcat_31/pro.html

I added the menus to my pages first & got them working with no problem.
However, when adding the nifty corners script links, they didn't work.
The nifty corners script links were listed first in the head. If I
changed the order of the script links in the head [putting the menu
first], the corners would round, but the menus wouldn't work.

My page is here:
http://www.t2000inc.com/test/
[with the menu listed last & working]

My CSS:
http://www.t2000inc.com/test/techcss.css
http://www.t2000inc.com/test/niftyCorners.css

The javascript files:
menu: http://www.t2000inc.com/test/menuDropdown.js
nifty corners: http://www.t2000inc.com/test/nifty.js
& http://www.t2000inc.com/test/corners.js

Please let me know if you need more information or detail. Thanks in
advance for any help!
Anne

Typical problem when pasting in multiple scripts: *dueling onloads*.
window.onload is an object property; like any other variable, multiple
assignments will simply over-write previous ones.

in "corners.js":

window.onload = function() { if(!NiftyCheck()) return;
Rounded("div#market li","all","transparent","#177F99","smooth");
Rounded("div#marketbox p","tr bl","#fff","#177F99","smooth"); }

in "http://www.t2000inc.com/test/":

window.onload = function() {
initializeMenu("trainingMenu", "trainingActuator");
initializeMenu("elearnMenu", "elearnActuator");
initializeMenu("partnersMenu", "partnersActuator");
initializeMenu("aboutUsMenu", "aboutUsActuator");
initializeMenu("contactMenu", "contactActuator");
}

Just remove the first and add it to the second:

window.onload = function()
{
initializeMenu("trainingMenu", "trainingActuator");
initializeMenu("elearnMenu", "elearnActuator");
initializeMenu("partnersMenu", "partnersActuator");
initializeMenu("aboutUsMenu", "aboutUsActuator");
initializeMenu("contactMenu", "contactActuator");
if(NiftyCheck())
{
Rounded("div#market li","all","transparent","#177F99","smooth");
Rounded("div#marketbox p","tr bl","#fff","#177F99","smooth");
}
}

Your menu needs a bit of work (mouse it to see). Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top