The following piece of code in php, uses a while statement to output variable $the_job_id. For each of the output I want to apply jquery slidetoggle. The problem is that in my code slidetoggle works only for the first output of my while. Not working for the rest. Any idea how i should modify my code in order slidetoggle to work for each of my while outputs?
This is my php code:
<?php
$result = mysql_query("select * from `user_job` where `job_id` IN ($all_saved_job_id) ");
while($run_job = mysql_fetch_array($result)){
$the_job_id = $run_job['job_id'];
echo"<div id='flip'> PRESS TO SLIDE </div>";
echo" <div id='panel'> $the_job_id </div>";
}// end while
?>
this is my script :
<script>
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
</script>
this is my css :
<style>
#flip{
cursor:pointer;
margin-left:100px;
}
#panel{
padding:0px;
display:none;
}
</style>