lancelot
03-01-2005, 12:28 AM
BTW, the code is incomplete on the page, which may take some time for the beginner to notice (it took me two days of staring at the code when I finally looked at the page source to compare the code...):
Posted on the page for users to copy:
<a href="#" onMouseover="modifyimage('dynloadarea', 0)">image 1 (onmouseover)</a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)">image 2 (onmouseover)</a><br>
<a href="#" onClick="return modifyimage('dynloadarea2', 2)">image 3 (onclick)</a><p>
<div id="dynloadarea" style="width:80px;height:225px"></div>
<div id="dynloadarea2" style="width:80px;height:200px"></div>
Viewed source code for that same page:
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img border="0" src="thumb1.jpg" width="50" height="50" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)"><img border="0" src="thumb2.jpg" width="50" height="50" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 2)"><img border="0" src="thumb3.jpg" width="50" height="50" style="margin-bottom: 5px"></a></td>
<td width="80"><!--webbot bot="HTMLMarkup" startspan --><div id="dynloadarea" style="width:50px;height:225px"></div><!--webbot bot="HTMLMarkup" endspan i-checksum="17728" --></td>
</tr>
</table>
Anyways, my question is that now that I have copied the correct code (from the source), and modified it to suit my pictures...I'm having troubles with the size of the expanded view pictures...even though this code: --><div id="dynloadarea" style="width:50px;height:225px"></div> seems to be the one which controls the size of the expanded pictures, it doesn't work?! It's loading the pictures at the size in which they were originially taken?!...any suggestions?...if you cannot spot the problem, here's my code for your purusal...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["pictures/gf.JPG", ""]
dynimages[1]=["pictures/photo radar van/5-0 photo radar van (rear).jpg", ""]
dynimages[2]=["photo3.jpg", ""]
//Preload images ("yes" or "no"):
var preloadimg="no"
//Set optional link target to be added to all images with a link:
var optlinktarget=""
//Set image border width
var imgborderwidth=0
//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
///////No need to edit beyond here/////
if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}
</script>
<title>Pimp 'n</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img border="0" src="pictures/tn_gf.jpg" width="100" height="90" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)"><img border="0" src="pictures/photo radar van/thumbnails/tn_5-0 photo radar van (rear).jpg" width="100" height="90" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 2)"><img border="0" src="thumb3.jpg" width="100" height="90" style="margin-bottom: 5px"></a></td>
<td width="80"><!--webbot bot="HTMLMarkup" startspan --><div id="dynloadarea" style="width:50px;height:225px"></div><!--webbot bot="HTMLMarkup" endspan i-checksum="17728" --></td>
</tr>
</table>
</body>
</html>
Posted on the page for users to copy:
<a href="#" onMouseover="modifyimage('dynloadarea', 0)">image 1 (onmouseover)</a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)">image 2 (onmouseover)</a><br>
<a href="#" onClick="return modifyimage('dynloadarea2', 2)">image 3 (onclick)</a><p>
<div id="dynloadarea" style="width:80px;height:225px"></div>
<div id="dynloadarea2" style="width:80px;height:200px"></div>
Viewed source code for that same page:
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img border="0" src="thumb1.jpg" width="50" height="50" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)"><img border="0" src="thumb2.jpg" width="50" height="50" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 2)"><img border="0" src="thumb3.jpg" width="50" height="50" style="margin-bottom: 5px"></a></td>
<td width="80"><!--webbot bot="HTMLMarkup" startspan --><div id="dynloadarea" style="width:50px;height:225px"></div><!--webbot bot="HTMLMarkup" endspan i-checksum="17728" --></td>
</tr>
</table>
Anyways, my question is that now that I have copied the correct code (from the source), and modified it to suit my pictures...I'm having troubles with the size of the expanded view pictures...even though this code: --><div id="dynloadarea" style="width:50px;height:225px"></div> seems to be the one which controls the size of the expanded pictures, it doesn't work?! It's loading the pictures at the size in which they were originially taken?!...any suggestions?...if you cannot spot the problem, here's my code for your purusal...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["pictures/gf.JPG", ""]
dynimages[1]=["pictures/photo radar van/5-0 photo radar van (rear).jpg", ""]
dynimages[2]=["photo3.jpg", ""]
//Preload images ("yes" or "no"):
var preloadimg="no"
//Set optional link target to be added to all images with a link:
var optlinktarget=""
//Set image border width
var imgborderwidth=0
//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
///////No need to edit beyond here/////
if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}
</script>
<title>Pimp 'n</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><a href="#" onMouseover="modifyimage('dynloadarea', 0)"><img border="0" src="pictures/tn_gf.jpg" width="100" height="90" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 1)"><img border="0" src="pictures/photo radar van/thumbnails/tn_5-0 photo radar van (rear).jpg" width="100" height="90" style="margin-bottom: 5px"></a><br>
<a href="#" onMouseover="modifyimage('dynloadarea', 2)"><img border="0" src="thumb3.jpg" width="100" height="90" style="margin-bottom: 5px"></a></td>
<td width="80"><!--webbot bot="HTMLMarkup" startspan --><div id="dynloadarea" style="width:50px;height:225px"></div><!--webbot bot="HTMLMarkup" endspan i-checksum="17728" --></td>
</tr>
</table>
</body>
</html>