所以我就它的工作就好了第一頁上我試了一下:Slide Toggle JQuery不工作
http://www.uksf.net/platoon.php
但我不能讓它在頭版上運行:
http://www.uksf.net/index.php(側面的導航欄應該有一個小菜單下拉(你可以在檢查員看到))。
這裏是代碼:
$this->con = $this->connect();
$query = $this->con->prepare('SELECT * FROM SideNav WHERE type = "top" ORDER BY displayorder ASC');
$query->setFetchMode(PDO::FETCH_ASSOC);
$query->execute();
while ($row = $query->fetch()){
echo'<div class="sn'.$row["id"].'">';
echo'<div class="sidelink">'.
$row["name"].'
</div>';
$query2 = $this->con->prepare('SELECT * FROM SideNav WHERE type = "bottom" AND parent = :id ORDER BY displayorder ASC');
$query2->bindParam(':id', $row["id"]);
$query2->setFetchMode(PDO::FETCH_ASSOC);
$query2->execute();
$rot = $query2->fetch();
if(!empty($rot))
{
echo'<div class="sn'.$row["id"].'group">';
echo'<div class="sidelinksub">';
$query2 = $this->con->prepare('SELECT * FROM SideNav WHERE type = "bottom" AND parent = :id ORDER BY displayorder ASC');
$query2->bindParam(':id', $row["id"]);
$query2->setFetchMode(PDO::FETCH_ASSOC);
$query2->execute();
while ($row2 = $query2->fetch()){
echo'<div>'.
$row2["name"]
.'</div>';
}
echo'</div></div>';
}
echo'<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
$(document).ready(function(){
$(".sn'.$row["id"].'").click(function(){
$(".sn'.$row["id"].'group").slideToggle("slow");
});
});</script></div>';
}
幻燈片切換不工作我已經花了幾天試圖解決這一問題,所以我還沒有來就突發奇想,幫助讚賞感謝。
這可能是有幫助的:'http://www.uksf.net/js/slideShow.js 404(Not Found)' – showdev