Bonsoir, j'affiche sur une page la photo et le nom des personne. Je voudrais afficher dans une fenêtre modal (par click) les toutes les informations sur une personne.
L'affichage est bon mais lorsque je click sur un n'importe quel nom c'est le premier enregistrement qui s'affiche.
j'ai trouver ce que code sur le NET mais je n'arrive pas à adapter à mon cas.
CSS
Code css : Sélectionner tout - Visualiser dans une fenêtre à part
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 .reveal-modal-bg { position: fixed; height: 100%;width: 100%;background: #000;background: rgba(0,0,0,.5);z-index: 100;display: none;top: 0;left: 0; } .reveal-modal { visibility: hidden; top: 100px; left: 50%;margin-left: -300px;width: 520px; background: #eee url(modal-gloss.png) no-repeat -200px -80px; position: absolute; z-index: 101; padding: 30px 40px 34px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0 0 10px rgba(0,0,0,.4); -webkit-box-shadow: 0 0 10px rgba(0,0,0,.4); -box-shadow: 0 0 10px rgba(0,0,0,.4); } .reveal-modal.small { width: 200px; margin-left: -140px;} .reveal-modal.medium { width: 400px; margin-left: -240px;} .reveal-modal.large { width: 600px; margin-left: -340px;} .reveal-modal.xlarge { width: 800px; margin-left: -440px;} .reveal-modal .close-reveal-modal { font-size: 22px; line-height: .5; position: absolute; top: 8px; right: 11px; color: #aaa; text-shadow: 0 -1px 1px rbga(0,0,0,.6); font-weight: bold; cursor: pointer; } </style>
Php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 foreach($listIntervenant as $data){ <a href="intervenant.php" class="link" data-reveal-id="myModal" data-animation="fade"> <img src="photos/<?php echo $data->image ?>" width="150" height="136" alt="" /> <div class="titleBlue" style="text-align:left;"><?php echo troncate($data->nom, 0, 150) ?><br /><span style="font-size:10px; font-style:italic; text-align:left;"><?php echo $data->fonction ?></span> </a> <div id="myModal" class="reveal-modal"> <div class="titleBlackDark"><?php echo $data->nom; ?></div> <div class="titleBlue"><?php echo $data->fonction; ?></div><br /> <div><img src="photos/<?php echo $data->image; ?>" alt="<?php //echo $nom; ?>" width="169" height="158" style="float:left; margin-right:10px; margin-bottom:0px;" /> <?php echo html_entity_decode($data->biographie); ?></div> <a class="close-reveal-modal"><img src="css/fermer.png" border="0" width="24" height="24" alt=""></a> </div> }
Partager