SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    NS6 and IE problems

    Im using a preload script that calls this function after the image has started loading. The script works fine, apart from one thing.

    In IE when all images have been loaded the value of document.loading.load equals 100, but in Netscape doesnt get up to 100, its always the percent under it (usually about 95, depending on how many pictures im preloading of course). Does anyone have any idea why?

    Here's the code:
    Code:
    var percent = 0;
    function checkload(index){
      if (imgloaded[index].complete) {
        percent = percent + 1;
        document.loading.load.value = (percent/imgs.length)*100;
      }
      else {
        id = setTimeout('checkload(' + index + ')', 100);
      }
    }
    Thanks
    JC

  2. #2
    SitePoint Addict
    Join Date
    Jan 2001
    Location
    Ottawa ON
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps if you linked to an example page, people could better see what's going on.

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The page is available here:
    http://joncade.hypermart.net/slide/

    Sorry about the popups, and the pictures actually. There are just the first 5 in a series (so you get the idea, but dont have the long loading times )

    Thanks
    JC
    Last edited by JonCade; Apr 11, 2002 at 04:18.

  4. #4
    SitePoint Addict
    Join Date
    Jan 2001
    Location
    Ottawa ON
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works for me in Mozilla 1.0. Since it works in Mozilla, it sounds like it might be a browser-specific bug to do with older Mozilla builds/Netscape. I can't test for that since I don't have Netscape 6 installed, only Mozilla which doesn't exhibit the problems you're describing.

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2002
    Location
    UK
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    i believe the problem is because you have javascript outside of the body and html tags

    i.e.

    Code:
    </body>
    </html><!-- ads begin -->
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    <!--
    move the </body></html> to the end of your page - should be the last tags

    hope this helps

    bit of a dodgy tugboat captain by the look of things
    Last edited by martm; Apr 25, 2002 at 07:30.


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
  •