我有一个显示子信息的切换开关工作,但以下切换不起作用,我不知道如何解决这个问题。我使用了 w3schools 的代码来让它工作,但其他名称似乎并没有滑下来,只是显示它们。请问有什么想法吗?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
</script>
<style type="text/css">
#panel,#flip
{
padding:5px;
text-align:center;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
}
#panel
{
padding:50px;
display:none;
}
</style>
$connect = mysql_connect("127.0.0.1" , "root" , "") or die ("Couldnt connect to database");
mysql_select_db("travellerfile") or die ("couldnt find the database");
$searchsurname = $_POST['Surname'];
$searchfirstname = $_POST['Firstname'];
$searchage = $_POST['Age'];
$query = mysql_query("SELECT * FROM child WHERE Surname like '%$searchsurname%' and Firstname like '%$searchfirstname%' and Age like '%$searchage%'");
while($row = mysql_fetch_array($query))
{
?>
<div id="flip"><?php echo $row['Firstname']; ?> <?php echo $row['Surname']; ?></div>
<div id="panel"><?php echo $row['DateOfBirth']; ?> <br /> <img src="<?php echo $row['sourcepath']; ?>" width="100px" height="100px"> <form method="post" action="childdetail.php">
<input name="Button1" type="submit" value="View" /></form>