| 12
 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
 
 |  
<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="PHPEclipse 1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>title</title>
<script language="javascript">
<!--
var img = new Array();
var div;
 
function init(){
	div = document.getElementById("select");
}
 
function Listen(e){
    if (!e) var e = window.event
    if (e.target) targ = e.target
    else if (e.srcElement) targ = e.srcElement
    if (targ.nodeType == 3) // defeat Safari bug
        targ = targ.parentNode;
    var tname;
    tname=targ.tagName;
    id = targ.id;
    if (tname == "IMG"){	
    	record(id,e.ctrlKey);
    }
}
 
function record(id,ctrl){
	if ( (img.indexOf(id) == -1) && ctrl){
		img.push(id);
	}
	else if (!ctrl){
		img = new Array(id);
	}
	showArray();
}
 
function showArray(){
	div.innerHTML = "";
	for(i=0; i < img.length; i++){
		div.innerHTML += img[i] + "<br>";
	}
}
-->
</script>
 
</head>
 
<body onmousedown="Listen(event)" onload="init()">
<div id="select"></div> 
<a href="javascript:void(0);" >test</a>
<img src="" width="400" height="400" id="img1"/>
<img src="" width="400" height="600" id="img2"/>
</body>
</html> | 
Partager