/    Sign up×
Community /Pin to ProfileBookmark

bizzare error with preloading

Hi

I have some rollover images in my page. I load them into some variables so that they can change quickly. Here is a part of the code:

[QUOTE]

function down_arrow_in()
{
if(ypos<=ifrh)document.down_arrow.src=img1.src;
scrolling_down = true;
}
function down_arrow_out()
{
if(ypos<=ifrh)document.down_arrow.src=img2.src;
scrolling_down = false;
}
function up_arrow_in()
{
if(ypos>=0)document.up_arrow.src=img3.src
scrolling_up = true;
}
function up_arrow_out()
{
if(ypos>=0)document.up_arrow.src=img4.src;
scrolling_up = false;
}

<body onLoad=”start()” background=”fortunes bg.gif” style=”background-repeat:no-repeat; “>

<script language=”javascript” type=”text/javascript”>
var img1=new Image();
img1.src=”down_arrow_down.gif”;
var img2=new Image();
img2.src=”down_arrow_up.gif”;
var img3=new Image();
img3.src=”up_arrow_down.gif”;
var img4=new Image();
img4.src=”up_arrow_up.gif”;

[/QUOTE]

You can see all the code at [URL=http://nic-nac-project.de/~razpat/#]http://nic-nac-project.de/~razpat[/URL] . Everything works fine except down_arrow_up.gif is loaded every time the cursor leaves the image. The strange thing is that all the other images are loaded in the same way and they don’t load only once. What does this image have so special?! Or where have i mistaken?!

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@vwphillipsFeb 27.2005 — had a quick look

but the major problem is that it is IE only(Ugg)

best thing would be to make it Xbrowser before alt else

will do this tomorrow
Copy linkTweet thisAlerts:
@razvanpatauthorMar 02.2005 — Thanks for replying. What do you mean by making it Xbrowser?
Copy linkTweet thisAlerts:
@vwphillipsMar 04.2005 — sorry I have been so long in replying, I had ment to spend some time on your page by now but something cropped up

Xbrowser meants that it should work in most bowsers, your page appears to be IE only at the moment, This is a pity as it is pretty(nice) and must have taken some time to produce.

Given the time since I last posted please let me know if you are interested in a Xbrowser version before I expend too much effort.
Copy linkTweet thisAlerts:
@razvanpatauthorMar 07.2005 — Don't worry about replying late.. I am also very busy and didn't find time to browse the forum. I made a different version of the page for browsers different from ie. All that is left for me to do is to make a script that detects your browser and redirects you to the ie page or to the other page. One problem i don't think i'm going to take the time to solve is the 800x600 screen compatibility. I don't think it's worth the effort. Tx for taking the time to look at my page. I'll send you a pm or e-mail when it's finished in case you want to see the final page.

About the bizarre error... it seems that sometimes the rollover works fine... i still don't know why... it has to be the browser's fault. All the other images are loaded in the exact same way so if there was a problem it should appear all over.
Copy linkTweet thisAlerts:
@vwphillipsMar 07.2005 — I will send a script that does not change the image

has one on top of other and makes top image hidden

also, best to have one page for all browsers
Copy linkTweet thisAlerts:
@vwphillipsMar 07.2005 — The site is currupting the code I post so I will put it on

[URL]http://www.vicsjavascripts.org.uk/DblImg.htm[/URL]
Copy linkTweet thisAlerts:
@razvanpatauthorMar 08.2005 — Tx for the tip. I'll use it in my future web pages.

Here on rollover i have to scroll the iframe too. It should be possible but I don't know how and also I have finished it. It may suffer changes to the text though. It is available at the same link. [URL=http://nic-nac-project.de/~razpat]http://nic-nac-project.de/~razpat[/URL]
Copy linkTweet thisAlerts:
@vwphillipsMar 08.2005 — good in IE but still does not work with MozFF
Copy linkTweet thisAlerts:
@razvanpatauthorMar 09.2005 — I use Mozilla Firefox 1 and works fine. What version do you have? And are you redirected to the corect page (htttp://nic-nac-project.de/~razpat/en/other/index.html) ?

PS: I know that it doesn't work with Opera because it autentificates as IE by default. But Opera is crap and i don't care that it won't work with it. Are there any other browser that are that stupid enough to autentificate as IE ?
Copy linkTweet thisAlerts:
@razvanpatauthorMar 09.2005 — I just tried Netscape, Mozilla, Galeon and Konqueror and they all worked fine.
×

Success!

Help @razvanpat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...