473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Image preload experiments (IE vs. Firefox) - Not a FAQ

cjl
OK:

I am really scratching my head over a preload / image swapping problem,
so I started conducting experiments:

http://www.saintrays.net/experiment1.html
http://www.saintrays.net/experiment2.html
http://www.saintrays.net/experiment3.html

View the source of each page to see the relevant javascript. All three
experiments work smoothly in both Firefox and IE for me.

The website I am developing uses the method in experiment3, that is at
run time a javascript file is dynamically added to the document which
contains some relevant variables, images are preloaded, and then
swapped. It can be seen at:

http://www.casespace.net/

It is designed to run at 1024 x 768 only, and the browser must be
'fullscreen'. This is accomplished with 'F11' in IE (plus enabling the
autohide feature after right clicking on the remaining title bar) and
with the 'Autohide' extension for Firefox. The instructions need work,
but are fairly straightforward.

The problem is that for casespace.net image swapping is not smooth in
IE, and it seems to recheck with the website each time I swap an image,
even though they are preloaded, greatly slowing down the ability to
quickly scroll through images. It works flawlessly in Firefox.

I can't find the difference between experiment3 (which works in IE
without the constant checking) and the method I use on casespace.

Any help would be appreciated. I am going nuts. Arrrgh.

-CJL

Nov 11 '05 #1
7 9080
cjl wrote:
OK:

I am really scratching my head over a preload / image swapping problem,
so I started conducting experiments:

http://www.saintrays.net/experiment1.html
http://www.saintrays.net/experiment2.html
http://www.saintrays.net/experiment3.html [...]
The problem is that for casespace.net image swapping is not smooth in
IE, and it seems to recheck with the website each time I swap an image,
even though they are preloaded, greatly slowing down the ability to
quickly scroll through images. It works flawlessly in Firefox.
Your casespace.net site did not work at all for me in either IE or Firefox.

I can't find the difference between experiment3 (which works in IE
without the constant checking) and the method I use on casespace.

Any help would be appreciated. I am going nuts. Arrrgh.


You script seemed overly complex to me - here's an alternative that
seems to work fine for me:
<script type="text/javascript">

var PicObj = {
loaded : 0,
showing : 0,
pics : [],
imgEl : null
};

function loader(numToLoad){
PicObj.imgEl = document.getElementById('the_image');
for (var i=0; i<numToLoad; ++i) {
PicObj.pics[i] = new Image();
PicObj.pics[i].src = 'mr0_' + i + '.jpg';
}
PicObj.loaded = --i;
PicObj.pics[PicObj.loaded].onload = looper;
}

function looper() {
PicObj.imgEl.src = PicObj.pics[PicObj.showing].src;
PicObj.showing = ++PicObj.showing % PicObj.loaded;
timeout_state = setTimeout("looper()", 50);
}

window.onload = function(){loader(26);}

</script>
--
Rob
Nov 11 '05 #2
cjl

RobG wrote:
Your casespace.net site did not work at all for me in either IE or Firefox.
I am interested to know what didn't work, particularly in Firefox,
because it is working fine here. Did you read through the
instructions?
You script seemed overly complex to me...


I know. I'm doing some strange things at 'run time', and I'm not a
very good programmer.

Thanks for the example code, I will go back to the drawing board with
the image preloading and swapping code, and see if I can't find the
problem through trial and error.

-CJL

Nov 11 '05 #3
cjl wrote:
RobG wrote:
Your casespace.net site did not work at all for me in either IE or
Firefox.


I am interested to know what didn't work, particularly in Firefox,
because it is working fine here. Did you read through the
instructions?


The problem, which puzzled me at first as well, is that you do not say
explicitly one has to click through all the instructions pages before
there is usable content on the Web site. "If you need instructions"
does not read much as being compulsory, however it is :)

Otherwise, it works fine im my Firefox 1.0.7/Linux, even though I do not
understand why you would have to make the UI so difficult to use (almost
keyboard-only, where the "almost" being an issue by itself). And many
conditions you set, as you say, "consistent user experience" (where there
is a typo, BTW), like browser and display resolution, are not really
required. Never ever expect anyone to change a running system because
of your Web site.
HTH

PointedEars
Nov 11 '05 #4
cjl

Thomas 'PointedEars' Lahn wrote:
The problem, which puzzled me at first as well, is that you do not say
explicitly one has to click through all the instructions pages before
there is usable content on the Web site. "If you need instructions"
does not read much as being compulsory, however it is :)
Sorry.
Otherwise, it works fine im my Firefox 1.0.7/Linux,
Good. even though I do not
understand why you would have to make the UI so difficult to use (almost
keyboard-only, where the "almost" being an issue by itself). And many
conditions you set, as you say, "consistent user experience" (where there
is a typo, BTW), like browser and display resolution, are not really
required. Never ever expect anyone to change a running system because
of your Web site.


Thank you for the feedback. My users will be a very narrow subset of
people, namely radiology residents at my hospital, where I can ensure
they all have the proper setup. I know that the UI needs some work,
but what I didn't tell you is that the controls very closely mimic are
PACS system, so most residents are comfortable with controlling it.

The real problem is still the preloading / image swapping in IE, which
I am unable to solve at this point. Any thoughts on this? Have you
tried it in IE to see what I am talking about.

Thanks again,
CJL

Nov 11 '05 #5
cjl wrote:
Thank you for the feedback.
You're welcome.
My users will be a very narrow subset of people, namely radiology
residents at my hospital, where I can ensure they all have the proper
setup. I know that the UI needs some work, but what I didn't tell you
is that the controls very closely mimic are PACS system, so most
residents are comfortable with controlling it.
So it should not be a public Web site in the first place, should it?
The real problem is still the preloading / image swapping in IE, which
I am unable to solve at this point. Any thoughts on this?
Not yet.
Have you tried it in IE to see what I am talking about.


Sorry, I don't have IE here.
PointedEars
Nov 11 '05 #6
IE specifically has issues with caching images, see if this page:
http://www.netmechanic.com/news/vol6/javascript_no1.htm is relevant to
your situation.

Nov 11 '05 #7
cjl

ro***********@gmail.com wrote:
IE specifically has issues with caching images, see if this page:
http://www.netmechanic.com/news/vol6/javascript_no1.htm is relevant to
your situation.


Thank you for the information.

While the reference describes the problem I am having with IE, the
solution does not work for me, as I am already using relative paths.

I am going to continue my experiments...arrrgh.

-CJL

Nov 11 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harod Ruthgar | last post by:
var image = new Image(); image.src="pathToTheFile"; The above code is called 25 times (with different pathToTheFile) within a loop. I manually checked the cache directory and not all images...
1
by: Peter Fastré | last post by:
Hello The javascript preload function I always used, is causing problems with the latest version of gecko-browsers. Never had any problems with it though. Maybe there's something wrong? ...
4
by: X l e c t r i c | last post by:
This isn't working and I can't figure out what I'm doing wrong: var c_imgs = new Array( 'images/champascari.jpg', 'images/champfangio.jpg', 'images/champhawthorn.jpg', 'images/champhill.jpg',...
3
by: jon | last post by:
Hello, I've had long standing code that runs in IE, that I'm testing with firefox unsuccessfully now. The problem seems to be that images that I dynamically create don't fire their onload event...
5
by: Cate Archer | last post by:
I'm trying to position images using CSS. I put inline style code in the <imgtag. Why does this line of code work in IE7 but not in Firefox 2.0? Anybody got a better way? <img height="160"...
2
by: g1r2a3 | last post by:
Hello: The following script // ======================================= // do not edit anything below this line // ======================================= var t var j = 0
0
by: AkbarAzizi | last post by:
Hi, Is there anybody who knows why my following java/Groovy code does not work in Firefox? The function ImageIO.createImageInputStream returns NULL in Firefox. The code works fine in Windows...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.