Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Javascript Problem

Options
  • 15-06-2009 2:58pm
    #1
    Registered Users Posts: 242 ✭✭


    Designing a site at the moment and i have to external .js files. 1 for a js submenu links script and one for a js fade slideshow script.

    The links were wroking perfectly until i added the slideshow.

    Now only the slide show works and the links dont and gives this error

    "Object doesnt support property or method."

    I have a feeling i have something tiny wrong that is breaking this but cant figure out what it is.

    Could it be that the slideshow is now where the submenu used to pop out and if that is the problem is there a way to bring the submenus in front of the slideshow?


Comments

  • Registered Users Posts: 6,511 ✭✭✭daymobrew


    Can you post a link to the page?

    Does the submenu work when the fade script is not included?
    Does the fade script work when the submenu script is not included?


  • Registered Users Posts: 242 ✭✭SD1990


    Hi daymobrew , thanks for the reply.

    The site is not live. It is in development. The Slideshow works fine regardless. The links work fine when the slideshow isnt there. I think the problem might be that it overlaps the links. i will try and reposition them and see if it works then. Having 2 different external js scripts wouldnt affect this would it ?


  • Registered Users Posts: 242 ✭✭SD1990


    The error is still there when i removed the slideshow.

    Im relatively new to javascript so dont know how to fix the error.

    Is there a way to bring the links to the front of the javascript?


  • Registered Users Posts: 130 ✭✭irishfeller


    You should check to see if there are any clashing element names/ids in the 2 javascript scripts. If your scripts use 'getElementById' calls for example they wont work properly if 2 elements share the same id.


  • Registered Users Posts: 242 ✭✭SD1990


    the only similar event is mouseover ? would this affect it ?

    Is there a way to code that the links appear over the slideshow? it is currently positioned absolute ( the sub menu ) but appears behind the slideshow. I cant reposition it because it wouldnt look right.


  • Advertisement
  • Registered Users Posts: 242 ✭✭SD1990


    heres the code.

    Submenu code
    startList = function() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover=function() {
    this.className+=" over";
      }
      node.onmouseout=function() {
      this.className=this.className.replace&#187;
     (" over", "");
       }
       }
      }
     }
    }
    window.onload=startList;
    


  • Registered Users Posts: 6,511 ✭✭✭daymobrew


    Please post the html code too.
    Looking at the javascript, could the same hover functionality be achieved with css?


  • Registered Users Posts: 242 ✭✭SD1990


    i just used another method. It was clashing because they were both using the getelementbyid as said above. All working fine now. Thanks for help lads !


Advertisement