Non approfittartene troppo... eh eh
devi preoccuparti di mettere su ciascuna immagine che vuoi ridimensionare questo:codice:<img name="p1" width="200" height="124" onclick="imgresize=this.name;"> <img name="p2" width="300" height="56" onclick="imgresize=this.name;"> <script> imgresize = ""; function keydown(e) { if(typeof(e)!="undefined") event = e; if(!event.keyCode && event.which) event.keyCode = event.which; if(document.layers) { var tasti = new Array(); tasti[92] = tasti[124] = 220; tasti[39] = tasti[63] = 219; tasti[236] = tasti[94] = 221; tasti[232] = tasti[233] = tasti[91] = tasti[123] = 186; tasti[43] = tasti[42] = tasti[93] = tasti[125] = 187; tasti[242] = tasti[231] = tasti[64] = 192; tasti[224] = tasti[176] = tasti[35] = 222; tasti[249] = tasti[167] = 191; tasti[60] = tasti[62] = 226; tasti[44] = tasti[59] = 188; tasti[46] = tasti[58] = 190; tasti[45] = tasti[95] = 189; tasti[47] = 111; tasti[42] = 106; tasti[45] = 109; tasti[43] = 107; tasti[33] = 49; tasti[34] = 50; tasti[163] = 51; tasti[36] = 52; tasti[37] = 53; tasti[38] = 54; tasti[40] = 56; tasti[41] = 57; tasti[61] = 48; if(event.keyCode >= 97 && event.keyCode <= 122) event.keyCode -= 32; else if(tasti[event.keyCode]) event.keyCode = tasti[event.keyCode]; } resizeImg(event.keyCode); } if(document.captureEvents) document.captureEvents(Event.KEYDOWN); document.onkeydown = keydown; function resizeImg(t) { var i = document.images[imgresize], w, h, delay=5; if(!i || !imgresize) return; w = i.width; h = i.height; if(t==187 || t==107) i.width+=delay; else if(t==189 || t==109) i.width-=delay; i.height = Math.round(i.width*h/w); } </script>
onclick="imgresize=this.name;"
ciao

Rispondi quotando