SitePoint Sponsor |
|
User Tag List
Results 1 to 13 of 13
Thread: Preloading images - IE 5 bug
-
Apr 30, 2001, 13:15 #1
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- 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
-
Apr 30, 2001, 14:28 #2
- 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
-
Apr 30, 2001, 15:31 #3
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- 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>
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
-
Apr 30, 2001, 21:20 #4
- 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.shtmlAdobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
May 1, 2001, 01:43 #5
- 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.
-
May 1, 2001, 06:19 #6
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- 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?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
-
May 1, 2001, 06:27 #7
- 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
-
May 1, 2001, 06:34 #8
- 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!
-
May 1, 2001, 07:42 #9
- 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.
-
May 1, 2001, 07:59 #10
- 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!
-
May 14, 2001, 10:47 #11
- 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.
-
May 15, 2001, 02:24 #12
- 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.
-
May 15, 2001, 04:28 #13
- 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