2 var maxListHeight = 120;
5 if (document.getElementById("singleimage")) single();
6 /*else if (document.getElementById("pictures")) list();*/
10 imageDivs = document.getElementsByName("listimage");
11 for (i=0; i < imageDivs.length; i++) {
12 currentHeight = imageDivs[i].offsetHeight;
13 currentWidth = imageDivs[i].offsetWidth;
15 if (currentHeight > maxListHeight) {
16 ratio = maxListHeight / currentHeight;
17 imageDivs[i].style.width = (currentWidth*ratio) + 'px';
18 imageDivs[i].style.height = (currentHeight*ratio) + 'px';
19 imageDivs[i].firstChild.style.height = '100%';
20 imageDivs[i].firstChild.style.width = '100%';
26 var imageDiv = document.getElementById("singleimage");
29 currentHeight = imageDiv.offsetHeight;
30 currentWidth = imageDiv.offsetWidth;
32 if (currentHeight > maxHeight) {
33 ratio = maxHeight / currentHeight;
34 imageDiv.style.width = (currentWidth*ratio) + 'px';
35 imageDiv.style.height = (currentHeight*ratio) + 'px';