Two scripts interfering with each other

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anne Kosmicki

    #1

    Two scripts interfering with each other

    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:
    Incorporating modern AV technologies in school theatres enhances performances, improves accessibility, and provides students with practical media skills for future careers.


    The second solution rounds the corners [nifty corners] on boxes:


    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:

    [with the menu listed last & working]

    My 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

  • McKirahan

    #2
    Re: Two scripts interfering with each other

    "Anne Kosmicki" <akosmicki@t200 0inc.com> wrote in message
    news:1114618783 .155220.21300@f 14g2000cwb.goog legroups.com...[color=blue]
    > 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_L...TML_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
    >[/color]

    And if JavaScript is disabled then no menues!


    Comment

    • RobB

      #3
      Re: Two scripts interfering with each other

      Anne Kosmicki wrote:[color=blue]
      > 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_L...TML_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[/color]
      problem.[color=blue]
      > However, when adding the nifty corners script links, they didn't[/color]
      work.[color=blue]
      > 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[/color]

      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#ma rket li","all","tran sparent","#177F 99","smooth") ;
      Rounded("div#ma rketbox p","tr bl","#fff","#17 7F99","smooth") ; }

      in "http://www.t2000inc.co m/test/":

      window.onload = function() {
      initializeMenu( "trainingMe nu", "trainingActuat or");
      initializeMenu( "elearnMenu ", "elearnActuator ");
      initializeMenu( "partnersMe nu", "partnersActuat or");
      initializeMenu( "aboutUsMen u", "aboutUsActuato r");
      initializeMenu( "contactMen u", "contactActuato r");
      }

      Just remove the first and add it to the second:

      window.onload = function()
      {
      initializeMenu( "trainingMe nu", "trainingActuat or");
      initializeMenu( "elearnMenu ", "elearnActuator ");
      initializeMenu( "partnersMe nu", "partnersActuat or");
      initializeMenu( "aboutUsMen u", "aboutUsActuato r");
      initializeMenu( "contactMen u", "contactActuato r");
      if(NiftyCheck() )
      {
      Rounded("div#ma rket li","all","tran sparent","#177F 99","smooth") ;
      Rounded("div#ma rketbox p","tr bl","#fff","#17 7F99","smooth") ;
      }
      }

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

      Comment

      Working...