W
WL Yang
Hi all,
I am green in javascripts, and facing one problem during waiting web
page. I want to display an image dynamitically in the page and use the
sentences below.
..............
..............
<script language="javascript">
if (document.layers) {
document.write("<img src='" + pics[0] + "' border=1 width=760
height=600 name='displayPic'>");
} else {
showPic(thePic,theSize);
}
........................
................
and it call this function;
function showPic(whichPic,whichSize) {
theSize = whichSize;
if (whichSize == "small") {
var content = "<img src='"+picsS[whichPic]+"' border=1
name='displayPic'>";
}
else {
var content = "<img src='"+picsL[whichPic]+"' border=1
width=760 height=600 name='displayPic'>";
}
}
if (isIE) {
document.all("picDiv").innerHTML = content;
}
if (isNS6) {
document.getElementById("picDiv").innerHTML = content;
}
showPicTime(whichPic);
}
I found that the same image will show twice ( they lies upward and
downward ) on the page when using netscape 7.0 but it will not when
using netscape 7.2 or IE.
am I writing some wrong inside the scripts? or the statement really
display it twice?
thks in advance.
wlyang
I am green in javascripts, and facing one problem during waiting web
page. I want to display an image dynamitically in the page and use the
sentences below.
..............
..............
<script language="javascript">
if (document.layers) {
document.write("<img src='" + pics[0] + "' border=1 width=760
height=600 name='displayPic'>");
} else {
showPic(thePic,theSize);
}
........................
................
and it call this function;
function showPic(whichPic,whichSize) {
theSize = whichSize;
if (whichSize == "small") {
var content = "<img src='"+picsS[whichPic]+"' border=1
name='displayPic'>";
}
else {
var content = "<img src='"+picsL[whichPic]+"' border=1
width=760 height=600 name='displayPic'>";
}
}
if (isIE) {
document.all("picDiv").innerHTML = content;
}
if (isNS6) {
document.getElementById("picDiv").innerHTML = content;
}
showPicTime(whichPic);
}
I found that the same image will show twice ( they lies upward and
downward ) on the page when using netscape 7.0 but it will not when
using netscape 7.2 or IE.
am I writing some wrong inside the scripts? or the statement really
display it twice?
thks in advance.
wlyang