I'm trying to transfer the slideHeight and slideWidth info from the JS function in the switch() section to the <body> section in order to display the photos using their correct heights and widths. The slideText info works OK.
I've just displayed the key code parts to simplify the problem.
Using height="slideHeight" and width="slideWidth" as shown doesn't work.
Any suggestions would be helpful.
Thanks
I've just displayed the key code parts to simplify the problem.
Using height="slideHeight" and width="slideWidth" as shown doesn't work.
Any suggestions would be helpful.
Thanks
Code:
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<img border="2" src="../myPhoto_1.jpg" name="showPhotoRotate" width="slideWidth" height="slideHeight" align="center"></td>
<tr>
<td width="100%" height="37"><p align="center"><b><font face="Arial" size="3"> <span id = "slideText"></span></font></b></td>
</tr>
</body>
<script language="JavaScript" type="text/JavaScript">
function testfn(){
var Photo=1;
switch (Photo) {
case 1:
document.showPhotoRotate.src = "file:///j:/myPhoto_1.jpg"
document.photoText="Photo 1"
document.getElementById("slideText").innerHTML = document.photoText
document.photoHeight="202"
document.getElementById("slideHeight").innerHTML = document.photoHeight
document.photoWidth="288"
document.getElementById("slideWidth").innerHTML = document.photoWidth
break
case 2:
document.showPhotoRotate.src = "file:///j:/myPhoto_2.jpg"
document.photoText="Photo 2"
document.getElementById("slideText").innerHTML = document.photoText
document.photoHeight="279"
document.getElementById("slideHeight").innerHTML = document.photoHeight
document.photoWidth="288"
document.getElementById("slideWidth").innerHTML = document.photoWidth
break
}
</script>
</html>