SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot lighter's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript menu last to load

    I have this javascript horizontal menu at the top of my site, but it's always the last to load up. This is terrible especially on slower connections, when one have to wait for all the other imgs to load finish before the menu shows up. Is there anyway to make the javascript load first?

    My url is http://www.plecofanatics.com/forum/
    PlecoFanatics.com - Pleco, Fish, Aquariums, Aquatic Forums.

  2. #2
    SitePoint Addict markchivs's Avatar
    Join Date
    Oct 2004
    Location
    Malvern Hills, UK
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wrap your content sections in <div> tags and give them unique id's. Then put an onLoad event handler on your <body> tag that calls a function to display these content sections in the order you want i.e.


    function fn_ShowContent(){
    //Display contentID1 followed by contentID2
    document.getElementById('contentID1').display = 'block';
    document.getElementById('contentID2').display = 'block';
    // etc etc

    }




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
  •