Besoin d'aide pour adapter un script
Salut a tous voila j'ai un site d'upload d'image et depuis longtemps je cherche un script pour afficher une image avec des dimention reduite tout en gardent l'image original et quand on clique dessu elle aparait dans ca taille réel.
donc j'ai réussi a avoire un script pour ca... mais le probleme c'est qu'il affiche directement l'image dans ca taille réel !
je done le code du script jespere que vous pourez m'aider...
Code:
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<html>
<head>
<title>Sans titre</title>
<script type="text/javascript" language="javascript">
var saveWidth = 0;
function clearOldValue() {
if (document.regform.indexemail.value == "your e-mail") document.regform.indexemail.value = "";
}
function showFullImg(whatShow,whatHide){
var whatShowE = document.getElementById(whatShow);
var whatHideE = document.getElementById(whatHide);
whatShowE.style.display = "block";
whatHideE.style.display = "none";
}
function scaleImg(whatShow, whatHide) {
showFullImg(whatShow, whatHide);
var what = whatShow;
what = document.getElementbyid(what);
if (navigator.appName == "Netscape")
winW = window.innerWidth;
if (navigator.appName.indexOf("Microsoft") != -1)
winW = document.body.offsetWidth;
if (what.width > (720) || saveWidth > (720)) {
if (what.width == (720))
what.width = saveWidth;
else
{
saveWidth = what.width;
what.style.cursor = "pointer";
what.width = (720);
}
}
}
function imageLoadError(){
alert("Image wasn\'t loaded properly by your browser. <Download Image> link may still be usable, however.")
}
function bodyOnload(){
if( saveWidth==0 ){
// this is for Opera where hidden images are not loaded
showFullImg('imageM','loading');
}
document.getElementbyid('bigImgContainer').innerHTML='<img id="image" onClick="showFullImg(\'imageM\',\'image\')"'+
'style="display:none"'+
'src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2.jpg" />';
}
</script>
<style type="text/css">
.rc {width:140px}
.cmnt {width:490px}
</style>
<meta name="generator" content="Namo WebEditor"></head>
<body onload='bodyOnload();'>
<p>
<table class="box" id="imageMain" width="100%">
<tr>
<td align="center" valign="middle" height="300">
<div class="loading" id="loading">
<img alt="" src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2_thumb.jpg"/>
<table>
<tr>
<td><img alt="Loading" src="/images/loading.gif"/></td>
<td>Loading image... Please wait.</td>
</tr>
</table>
</div>
<img id="imageM" onClick="showFullImg('image','imageM')"
onLoad="showFullImg('imageM','loading')" style="display:none"
onerror="setTimeout('imageLoadError()',1000)"
src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2.jpg?sizeM=3"
alt="bikini azul.JPG"/>
<span id="bigImgContainer"></span>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</body>
</html> |