我的锚标记不工作,理想的网址是localhost/VShroff/home/about.php,但是URL更改为localhost/about.php,并且也没有重定向。自从很长一段时间以来,我一直在努力解决这个问题。Anchor Tag behaviour怪异
以下是HTML:使用下面的jQuery和CSS
<html>
<head>
<meta name="generator"
content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
<title></title>
</head>
<body>
<div class="row" style="margin:10px;">
<div id="blocka" class="column col-md-6" style="padding:20px;width:150px;height:150px;background-color:#DA0A82">
<ul>
<li>
<a style="font-family:perpetua;font-size:16px;color:white;" href="about.php">About</a>
</li>
<li id="family" class="family" style="font-family:perpetua;font-size:16px;color:white;">Family</li>
<li id="ent" class="ent" style="font-family:perpetua;font-size:16px;color:white;">Enterprise</li>
<li style="font-family:perpetua;font-size:16px;color:white;">News & Media</li>
<li style="font-family:perpetua;font-size:16px;color:white;">Resources</li>
</ul>
</div>
<div id="familyNav" class="familyNav column col-md-6"
style="margin-left:10px;padding:20px;width:150px;height:150px;background-color:#7D0651">
<ul>
<li style="font-family:perpetua;font-size:16px;color:white;">Timeline</li>
<li style="font-family:perpetua;font-size:16px;color:white;">Tree</li>
<li style="font-family:perpetua;font-size:16px;color:white;">Biographies</li>
</ul>
</div>
<div id="enterprise" class="enterprise column col-md-6"
style="margin-left:10px;padding:20px;width:150px;height:150px;background-color:#7D0651">
<ul>
<li style="font-family:perpetua;font-size:16px;color:white;">Parimal K. Shroff & Co.</li>
<li style="font-family:perpetua;font-size:16px;color:white;">Sunways Group</li>
<li style="font-family:perpetua;font-size:16px;color:white;">Organograms</li>
<li style="font-family:perpetua;font-size:16px;color:white;">The Shroffice</li>
</ul>
</div>
</div>
</body>
</html>
林:
<script>
$('.family').click(function() {
$('#enterprise').hide();
$('#familyNav').slideToggle('2000',"swing", function() {
// Animation complete.
});
});
$('.ent').click(function() {
$('#familyNav').hide();
$('#enterprise').slideToggle('2000',"swing", function() {
// Animation complete.
});
});
</script>
<style>
#blocka {
z-index: 100;
}
#familyNav {
display:none;
}
#family {
cursor:pointer;
}
#enterprise {
display: none;
}
#ent {
cursor: pointer;
}
</style>
编辑:当我将鼠标悬停我的鼠标在链接上,它显示了正确的URL(本地主机/directories/about.php)然而,当我点击它时,没有任何反应,但浏览器的网址变成了localhost/about.php(该页面没有被重定向到localhost/about.php)
可能你有' '标签吗? –
Midas
关于菜单定位标记不工作或其他菜单? – Mani
没有标签正在工作。而且我没有任何基础href –