[JavaScript]
Vaub
-
Vaub -
Vaub -
Bonjour, je voudrais un code pour avoir la Height/Width de l'image:
<script>
function gallery(url)
{
window.open(url, "Image", "width=, height=, location=no, menubar=no, resizable=no, status=no, directories=no");
}
</script>
<img src="image1.jpg" onclick="gallery('image1.jpg');">
<script>
function gallery(url)
{
window.open(url, "Image", "width=, height=, location=no, menubar=no, resizable=no, status=no, directories=no");
}
</script>
<img src="image1.jpg" onclick="gallery('image1.jpg');">
1 réponse
Salut!
;-)
HackTrack
<html> <head> <script> function getSize(url){ img = new Image(); img.src=url; return {"width": img.width, "height": img.height}; } </script> </head> <body> <img src="http://www.commentcamarche.net/communaute/thumbs/HackTrack" onclick="javascript:s = new Array();s=getSize(this.src);alert(s.width+'x'+s.height);" /> </body> </html>
;-)
HackTrack
Vaub
Merci, mais ce n'est pas exactement ce que je cherche... Je voudrais plutôt ouvrir window.open(image, "Image", "height=(hauteur de l'image), width=(largeur de l'image)"); , car il va y avoir plusieurs images sur ma pages.