SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using ie 5 and I was preloading these images for a rollover and I noticed the preloading wasn't working.

    I looked at my code from all angles and couldn't figure it out - checked online examples on how to do it - same way I'm doing it.

    Checked a different browser - worked fine.

    So is there a security setting in IE that may disable preloading stuff? Or idoes my browser just need to be reinstalled?
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the code sample?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the coding is right.

    Code:
    <script language = "javascript">
    <!--
    if (document.images)
    {
    beige1=new Image(120,35);
    beige1.src="tabs/1_beige.gif";
    beige2=new Image(123,35);
    beige2.src="tabs/2_beige.gif";
    beige3=new Image(122,35);
    beige3.src="tabs/3_beige.gif";
    beige4=new Image(122,35);
    beige4.src="tabs/4_beige.gif";
    beige5=new Image(119,35);
    beige5.src="tabs/5_beige.gif";
    green1=new Image(120,35);
    green1.src="tabs/1_green.gif";
    green2=new Image(123,35);
    green2.src="tabs/2_green.gif";
    green3=new Image(122,35);
    green3.src="tabs/3_green.gif";
    green4=new Image(122,35);
    green4.src="tabs/4_green.gif";
    green5=new Image(119,35);
    green5.src="tabs/5_green.gif";
    }
    //-->
    
    </script>
    but IE just doesn't want to preload them.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm...

    I use pretty much the same code and I don't have problems with it. Have you tried taking out the variables in the image assignment?

    This is the code that I use:

    image1on = new Image();
    image1on.src = "images/about_us_on.gif";
    image1off = new Image();
    image1off.src = "images/about_us_off.gif";

    Check out this site and tell me if the preloader works.

    http://www.kbxl-kspd.com/index.shtml
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've noticed this problem, too. And it affects Dreamweaver code just as much as hand-coded JS. I don't think there's much you can do, unfortunately.

  6. #6
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope creole - didn't work for me.

    I think its just an IE bug since it works fine in NS.

    I use pretty much the same code and I don't have problems with it. Have you tried taking out the variables in the image assignment?
    I started with it that way - and when it wasn't working right I added that to see if it'd fix it - it didn't.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...if that site doesn't work then it is a bug with IE 5. That's weird. I wonder why it happens. IE 5 understand documents.images right? It has to since it can understand rollovers.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It may be that IE thinks it has finished loading the document when it hasn't in actual fact. IE5.5 can do the same sometimes.

    Basically, I think the browser is timing out on its rendering of the page. That's all!

  9. #9
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aspen I notice you have underscores. A while ago I had problems with a js function for an open window and it was not working on some browsers. Someone suggested getting rid of the underscores and then it worked. Could have been a coincidence and redoing the code fixed something I missed. I am seeing more stuff advising against underscores in css.

  10. #10
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gthorley, the underscores that you mention are part of the file name, so I don't understand why these should be problematic.

    Are there any actual instances where underscores have caused you problems. Can you point to any references you've found on the web?

    Nonetheless, it is an interesting point. I think I may have encountered a similar quirk in NS6. I'm not sure whether this was to do with underscores in the object IDs I had, or if it was just NS6 misbehaving over the slightest markup error, but it did seem to stumble at certain times when there was no apparent reason for doing so.

    Strange, very strange!

  11. #11
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have run intot htis problem many times before, and the only thing I could find out, that if you do not have in your body tag, and onload event, your images will not preload. So you need ot make a call like this for all preloading to occure:

    <body onload="PreLoader();">

    This will work, as this is what do now for every site I develope and I ahve not problems with the proloading anymore.

  12. #12
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dnd ...

    This shouldn't matter. If you put your reference your rollovers outwith a JS function in the head of the document, they should automatically load.

    I personally use window.onload and call a function initDoc which calls the preload script, that way the graphics load before the body loads. It's meant to be seamless, and yet if the page is trying to load a lot of bytes, or is making many calls to the server, it can time out.

    But I don't think, using the onLoad handler in the <body> tag should matter, since I've seen this fail as many times as not - and usually with Dunceweaver's industrial strength code.

    I think it's a pity that the quality site that is msdn.microsoft.com/workshop/ should be let down by having no bug list feature. This is something MS could learn from Netscape: a little honesty about their products' failings can really help the developer.

  13. #13
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shame on you! Microsoft software never has bugs. I once received a message from a microsoft person on usenet to a bug I posted in the (then new) version 5 of Outlook Express for Mac explaining that there were no bugs in the software. I should have kept it!

    I believe what you might be getting confused about is that from time to time Microsoft previews certain features in their software that are not fully supported yet. As Microsoft brings out newer versions of its software support for these features is further enhanced while new features are added.

    Sorry, I have nothing helpful to add to solving the problem. Well maybe I do...

    I am not very experienced with JavaScript so it is not natural to me (yet). However, in most languages you are required to declare your variables. Perhaps this is so with IEs implimentation of JavaScript?

    If these variables have not been declared elsewhere perhaps you could try this:

    var beige1=new Image(120,35);

    etc... Of course I'm assuming that that block of code is in global scope, otherwise you would declare the variables in global scope.

    OK ... so I went of and did some reading and technically you don't need to explicitly declare variables (I always do because of my C++/Java background) - but I would give this a go to see if it solves your problem.
    Last edited by freakysid; May 15, 2001 at 08:52.


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
  •