javascript - Jquery only show/hide but only one instance -


i building interface in when user clicks on target display new menu, interface, has multiple instances of target , each target shows same menu, want show menu under target has been clicked, @ moment, whatever target click menus become visible.

$('.statuses').hide(); $('.employer .status').click(function(e){     alert('clicked');     $('.employer .status').next('.statuses').show(); }); 

and html

<div id="left-column"> <?php foreach($jobs $j): ?> <p><strong><?php echo $j['jobtitle']; ?></strong> &pound;<?php echo $j['salary']; ?>, <?php echo $j['job_summary']?> </p>     <ul>     <?php foreach($applications $a): ?>         <?php if ($j['jobtitle'] == $a['jobtitle']): ?>             <li>                 <img src="/media/uploads/candidates/<?php echo preg_replace('/(.gif|.jpg|.png)/', '_thumb$1', $a['profile_image']);?>" width="90" height="60" alt="hello"/>                 <p><?php echo $a['name']; ?></p>                 <p class="<?php echo $a['status'];?> status"><?php echo ucfirst($a['status']);?></p>                 <div class="statuses">                     <p class="status pending"><a href="/employer/status/aid/<?php $a['id'];?>/pending">pending</a></p>                     <p class="status unsuccessful"><a href="/employer/status/aid/<?php $a['id'];?>/unsuccessful">unsuccessful</a></p>                     <p class="status successful"><a href="/employer/status/aid/<?php $a['id'];?>/successful">successful</a></p>                 </div>                 <p class="date"><?php echo date("d.m.y", $a['created_at']);?></p>             </li>         <?php endif; ?>     <?php endforeach; ?>  </ul> <?php endforeach; ?> 

$('.statuses').hide(); $('.employer .status').click(function(e){     $(this).next('.statuses').show(); }); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -