Bonsoir tout le monde,

J'essaie pour l'instant de mettre au point une petite galerie photo, j'ai quelque peu alléger le code (pas mis les CSS) de manière à ce qu'il ne soit pas trop long à parcourir. Sous ie6 - ie7, ça fonctionne sans problème. Mais firefox semble rétissant... Quelqu'un voit le pourquoi du comment?

Merci.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<script>
		function initializeScripts(){
			initializeClickableImages();
		}
 
		function initializeClickableImages(){
			clickableImages = findTagsByAttribute('img','className','clickable');
			for(ci=0 ; ci<clickableImages.length ; ci++){
				window.status +="Image" + parseInt(ci+1) + " initialized"; 
				clickableImage = clickableImages[ci];
				clickableImage.onclick=displayImage;
			}		
		}
 
		function displayImage(){
			tdCentre = findTagsByAttribute('td','className','frame centre')[0];
 
			img = new Image();
			img.src = this.src;
			img.width = this.width;
			img.height = this.height;
			img.alt=this.alt;
			xyFactor = this.width/this.height;
			if(xyFactor>0){
				img.width=460;
				img.height=parseInt(img.width/xyFactor);
			}else if(xyFactor<0){
				img.setAttribute("height","320");
				img.setAttribute("width",parseInt(img.height)*xyFactor);				
			}else{
			}
			tdCentre.innerHTML="<center>"+img.outerHTML+"<p/><span style='color: #eeeeee; padding: 10 0 10 0;'>"+img.alt+"</span></center>";	
		}
 
		function findTagsByAttribute(tagName, attributeName, attributeValue){
			tagList = document.getElementsByTagName(tagName);
			return findElementsByAttribute(tagList, attributeName, attributeValue)
		}
 
		function findElementsByAttribute(elmList, attributeName, attributeValue){
			elms = new Array();
			for(i=0 ; i<elmList.length ; i++){
				elm = elmList[i];
				if(elm.getAttribute(attributeName).toUpperCase()==attributeValue.toUpperCase()){
					elms[elms.length]=elm;
				}
			}
			return elms;
		}
</script>
 
<div onMouseOver="initializeScripts();">	
	<table class="frame" ">
		<tr width="">	
			<td class="frame miniatures">
				Cliquez sur une photo pour l'aggrandir
				<p/>
				<?php                           
                 print "<img class='clickable' src='./Paris/1.jpg' width='40px'/>";
                                ?>
			</td>	
		</tr>
		<tr width="">
			<td class="frame centre" >
 
			</td>
		</tr>
	</table>
</div>