Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preload images prob-[javascript conflict or something]

Status
Not open for further replies.

korndogg

Programmer
Jun 26, 2000
22
BA
hey :) i'm having problem with an IE(netscape works just fine)...I have preload images script(from dreamweaver) an a simple script to open a window.Now everything works fine(the images are preloaded),until I call that javascript to open a popup win.Then(when I move mouse over the links) the browser downloads the "over" images,again,as if they were not preloaded.Any help will be appreciated.Thanx
 
I tried it and no problem???

Could you post your code so we can see if there's some wrong??

Or post a link to it
Have Fun...

Sharky99 >:):O>
 
here's the java script,please have in mind that variables and description are not in eng. :)
<script language=&quot;JavaScript&quot;>
<!--
function ucitaj_slike() {
var d=document; if(d.images){ if(!d.zaustavi) d.zaustavi=new Array();
var i,j=d.zaustavi.length,a=ucitaj_slike.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.zaustavi[j]=new Image; d.zaustavi[j++].src=a;}}
}

function nadji_objekat(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=nadji_objekat(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function zamjena(dogadjaj, ime) {
var i,img,argumenti,args=zamjena.arguments;
if (dogadjaj == &quot;init&quot; && args.length > 2) {
if ((img = nadji_objekat(args[2])) != null && !img.init) {
img.init = true; img.up = args[3]; img.dn = img.src;
if ((argumenti = document[ime]) == null) argumenti = document[ime] = new Array();
argumenti[argumenti.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = nadji_objekat(args)) != null) {
if (!img.up) img.up = img.src;
img.src = img.dn = args[i+1];
argumenti[argumenti.length] = img;
} }
} else if (dogadjaj == &quot;over&quot;) {
document.nbOver = argumenti = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = nadji_objekat(args)) != null) {
if (!img.up) img.up = img.src;
img.src = (img.dn && args[i+2]) ? args[i+2] : args[i+1];
argumenti[argumenti.length] = img;
}
} else if (dogadjaj == &quot;out&quot; ) {
for (i=0; i < document.nbOver.length; i++) {
img = document.nbOver; img.src = (img.dn) ? img.dn : img.up; }
} else if (dogadjaj == &quot;down&quot;) {
if ((argumenti = document[ime]) != null)
for (i=0; i < argumenti.length; i++) { img=argumenti; img.src = img.up; img.dn = 0; }
document[ime] = argumenti = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = nadji_objekat(args)) != null) {
if (!img.up) img.up = img.src;
img.src = img.dn = args[i+1];
argumenti[argumenti.length] = img;
} }
}

function prikazi_status(poruka) {
status=poruka;
document.vrati_vrijednost = true;
}
//-->
</script>
<script type=text/javascript>
var prozor= null;
function OtvoriProzor(lokacija,ime,sirina,visina){ //Otvaranje centriranog prozora
var prozorl = (screen.width-sirina)/2;
var prozort = (screen.height-visina)/2;
var opcije ='height='+visina+',';
opcije +='width='+sirina+',';
opcije +='top='+prozort+',';
opcije +='left='+prozorl+',';
opcije +='scrollbars=yes,';
opcije +='resizable=no';
win=window.open(lokacija,ime,opcije);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top