我想用jquery创建一个菜单栏。我使用下面的代码,菜单栏中的jquery动画
<div class="menu">
<table align="center">
<tr>
<td class="menu_item" style="background:green;" >
<a style="color: white;" href="index.php?view=Index">Home</a>
</td>
<td class="menu_item" style="background:blue;" >
<a style="color: white;" href="index.php?view=Services"> Service </a>
</td>
<td class="menu_item" style="background:red;" >
<a style="color: white;" href="index.php?view=About"> About </a>
</td>
<td class="menu_item" style="background:yellow;" >
<a style="color: white;" href="index.php?view=Download"> Download</a>
</td>
<td class="menu_item" style="background:pink;" >
<a style="color: white;" href="index.php?view=Contact"> Contact</a>
</td>
</tr>
</table>
</div>
<hr>
<script>
$(document).ready(function(){
//When mouse rolls over
$(".menu_item").mouseover(function(){
$(this).slideUp(1000, method, callback});
//When mouse is removed
$(".menu_item").mouseout(function(){
$(this).slideUp(1000, method, callback});
});
</script>
鼠标悬停和鼠标进行功能工作,我检查那些使用警告框,但没有正在发生变化的物品......?我哪里错了?
我甚至没有看到语法错误,只是被表格分散以创建菜单,我认为一排TD总是有s ame高度,所以slideUp效果不会有结果。 – 2011-03-23 08:45:23
@Han Dijk但你说得对。这种方法根本上是错误的:) – jensgram 2011-03-23 08:49:33