I have one problem with my site that I can’t fix. I know noting about javascript. This is a plug-in and I need to make what I hope is a small change but looking at responses to similar questions in this forum I can’t figure it out. The script opens an image in the same page when the corresponding thumbnail is clicked. I have set the image to open to 65% so that it is relative to the browser window size but what I would like to add is something like
if image width = 640 px then width is 75%
else if height = 480 px then height is 65%
I am using it at
[URL=http://kgrantphoto.com/page/domr.php]this site
This is the code I am using so thanks if anyone can offer some help.
had a small script in php that resized images too a thumbnail. I also have a javascript image viewer on the page.
I read a directory with images and load the image names into a list (form). When you select an image and press a show button the image is shown on the page.
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+'” width=”65%”>’
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
}}