The different parts of your content need to be in separate identified divs.
Code:
<div id="menu">
<ul>
<li class="header">My menu</li>
<li><a href="page1.php" id="content1"><span>Search name<span></a></li>
<li><a href="page2.php" id="content2"><span>Search fname<span></a></li>
<li><a href="page3.php" id="content3"><span>Search lname<span></a></li>
</ul>
</div>
<div id="content">
<div id="content1">
<a href="page1.php"><span>Search name</span></a>
</div>
<div id="content2">
<a href="page2.php"><span>Search fname</span></a>
</div>
<div id="content3">
<a href="page3.php"><span>Search lname</span></a>
</div>
</div>
Your script needs to go through each of the menu links (not the content ones)
Code:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function()
{
$("div#menu").on("click","a",function(event)
{
event.preventDefault();
$("div#menu a").each(function(){
$(this).hide();
});
})
});
</script>
and use the link as a selector so that you can hide the target.
Your script also needs to use the link of the one that was clicked, to show the target of that link
I have no idea on this,can you please show me what you mean?
Bookmarks