Results 1 to 2 of 2

Thread: 2 javascripts conflicting

  1. #1
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 2 javascripts conflicting

    I'm using a navbar javascript which initialises on 'window.onload'. It's one of those drop-down style menus which appear on hover.

    Also on the page I'm using a slideshow javascript. This script preloads the images used in the slideshow.

    Unfortunately what's happening is as the page loads, navbar's dropdown menus all show, as the slideshow takes a few seconds to load its images. Only once these slideshow images are loaded is the window completely loaded, after which the navbar javascript runs. It's not until this javascript runs that the navbar's dropdown menus hide until they are rolled over.

    The result is my page looks like a mess for a few seconds until the navbar menus disappear. How can i fix this?1

  2. #2
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i've fixed this myself. in my navbar.js script i simply replaced "window.onload = mladdevents;" with "mladdevents();" and placed the "<script language="JavaScript" src="js/navbar.js"></script>" line after my navbar html, to be sure that navbar.js only gets initialised AFTER the navbar html has loaded.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •