alaios
08-09-2002, 09:05 PM
Hi I use this script to change one icon with an other
<body bgcolor="#FFFFFF" text="#000000">
<img src="wtf.jpg" name="pic1">
<script language="JavaScript">
<!--
function temp() {
x='wtf2.jpg';
return x;
}
window.alert('stop');
//meta apo edw i pic1 allazei
document.images.pic1.src=temp();
//-->
</script>
Everything are ok in IE5 and opera 5 . But the Netscape changes the one icon with the other. The problem is that the second picture does not appear correctly, because it uses the dimension of the first picture!!! An another problem is that if I change the window size when I am doing double click in the blue bar then the first icon appears again!!! AAAAA
What I must do?
Another example
<a href="temp"><img src="transparent.gif" name="pic1" border="0" alt="Κλείσιμο Παραθύρου"> </a>
<script language="JavaScript">
<!--
var width=document.images['pic1'].width;
var height=document.images['pic1'].height;+
window.resizeTo(width,height);
if (window.screen) {
self.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
}
document.images.pic1.src=1.jpg;
//-->
</script>
In this example the transaparent.gif changes to 1.jpg and then very fast change back to transparent.gif….
I face this problem only in Netscape 4.75 . Opera 5 and ie5 works perfectly!!
What I must do ?
Is there any difference between
document.images.pic1.src
and
document.images['pic1'].src
Thank u_!
Alexandros_!
<body bgcolor="#FFFFFF" text="#000000">
<img src="wtf.jpg" name="pic1">
<script language="JavaScript">
<!--
function temp() {
x='wtf2.jpg';
return x;
}
window.alert('stop');
//meta apo edw i pic1 allazei
document.images.pic1.src=temp();
//-->
</script>
Everything are ok in IE5 and opera 5 . But the Netscape changes the one icon with the other. The problem is that the second picture does not appear correctly, because it uses the dimension of the first picture!!! An another problem is that if I change the window size when I am doing double click in the blue bar then the first icon appears again!!! AAAAA
What I must do?
Another example
<a href="temp"><img src="transparent.gif" name="pic1" border="0" alt="Κλείσιμο Παραθύρου"> </a>
<script language="JavaScript">
<!--
var width=document.images['pic1'].width;
var height=document.images['pic1'].height;+
window.resizeTo(width,height);
if (window.screen) {
self.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
}
document.images.pic1.src=1.jpg;
//-->
</script>
In this example the transaparent.gif changes to 1.jpg and then very fast change back to transparent.gif….
I face this problem only in Netscape 4.75 . Opera 5 and ie5 works perfectly!!
What I must do ?
Is there any difference between
document.images.pic1.src
and
document.images['pic1'].src
Thank u_!
Alexandros_!