Bonjour,
J'ai un petit problème, je pense tout bête, de JQuery.
Je n'arrive pas à récupéré la source de mon image !
j'ai "undefined" et je ne vois pas pourquoi.
Merci.
PHP
JQuery
J'ai un petit problème, je pense tout bête, de JQuery.
Je n'arrive pas à récupéré la source de mon image !
j'ai "undefined" et je ne vois pas pourquoi.
Merci.
PHP
<div id="galerie">
<?php
$nbimg = count($fichier);
for ($i=1;$i<$nbimg+1;$i++)
{
echo '<a href="#">';
echo '<img src="'.$dirImg.$fichier[$i].'" alt="image de la commune" title="cliquez pour zoomer" onclick="Zoomit();" />';
echo '</a>';
}
?>
</div>
JQuery
function Zoomit()
{
//$(this).find("img").css("border","9px solid red");
//alert( $(this) );
var urlimg= $("img",this).attr("src");
var moi = $(this);
var moi2 = $(this).find("img");
var moi3 = $("img",this);
alert(urlimg);
$(this).css("border","9px solid blue");
//$("img",this).css("border","9px solid blue")
}