test sur une image(fonction)
Posté : 31 mars 2007, 06:22
Bonjour,
j'ai une fonction qui m'affiche une table, l'ennui c'est que les lignes qui sont vide m'affiche une le cadre de l'image absente et donc je cherche l'astuce pour ne pas afficher l'image absente si il n'y a rien dans la ligne demander.
http://88.167.164.83/jean-paul/index_xajax.php
j'ai une fonction qui m'affiche une table, l'ennui c'est que les lignes qui sont vide m'affiche une le cadre de l'image absente et donc je cherche l'astuce pour ne pas afficher l'image absente si il n'y a rien dans la ligne demander.
http://88.167.164.83/jean-paul/index_xajax.php
function produitvu() {
$reponse = new xajaxResponse();
$req="SELECT DISTINCT rubrique FROM pages";
$query = mysql_query($req);
$txt = '';
$txt.='<table id="diaporama">';
$i=0;
while($tb = mysql_fetch_assoc($query)){
if($i%9 == 0) $txt .= '<tr>';
$txt .= '<td>';
$txt .= '<a href="javascript:void(0);" OnClick="xajax_detailvu(\'' . $tb['rubrique'] . '\');">';
$txt .= '<img src="./conte/'.$tb['rubrique'].'.png" alt="'.$tb['rubrique'].'" style="width:81px;height:64px;border:1px solid black;" onMouseOver="diaporama_bigimg('.($i+1).')" id="diaporama_img_'.($i+1).'" /><br />';
$txt .='<span id="menu_carte">';
$txt .= $tb['rubrique'] . '</span></a>';
$txt .= '</td>';
if(($i+1%9) == 0) $txt .= '</tr>';
$i++;
}
$txt .= '</table>';
$reponse->addAssign("menu_conte", "innerHTML", $txt);
$reponse->addScriptCall("xajax_date_local");
$reponse->addScriptCall("xajax_insertion_stat");
$reponse->addScriptCall("xajax_pied_page");
return $reponse->getXML();
}
j'ai essayer avec un test sans succès ? if (isset($tb['rubrique'])) {
$txt .= '<img src="./conte/'.$tb['rubrique'].'.png" alt="'.$tb['rubrique'].'" style="width:81px;height:64px;border:1px solid black;" onMouseOver="diaporama_bigimg('.($i+1).')" id="diaporama_img_'.($i+1).'" /><br />';
$txt .='<span id="menu_carte">';
$txt .= $tb['rubrique'] . '</span></a>';
}
Merci