try This
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>mouseover demo</title>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<style>
.invisible
{
display: none;
}
.lorem
{
height: 300px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
getContent();
});
$(window).bind('hashchange', function (e) {
getContent();
});
function getContent() {
var url = window.location.toString();
var hash = url.substring(url.indexOf('#'));
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 2000);
$(hash).fadeIn();
$(hash).siblings("div").fadeOut();
}
</script>
</head>
<body>
<div class="lorem">
<div id="section1" class="invisible">
Content 1
<p style="text-align: justify;">
Content 1 content</p>
</div>
<div id="section2" class="invisible">
Content 2
<p style="text-align: justify;">
Content 2 content</p>
</div>
<div id="section3" class="invisible">
Content 3
<p style="text-align: justify;">
Content 3 content</p>
</div>
<div id="section4" class="invisible">
Content 4
<p style="text-align: justify;">
Content 4 content
</p>
</div>
</div>
<div id="links">
<a href="#section1" rel="section1" id="section1">Section 1</a>
<br />
<a href="#section2" rel="section2" id="section2">Section 2</a>
<br />
<a href="#section3" rel="section3" id="section3">Section 3</a>
<br />
<a href="#section4" rel="section4" id="section3">Section 4</a>
</div>
</body>
</html>
Is this what you are looking for. On load the page will look for the #section to show the content. On click of the anchor the hash link will be changed and the hash change function will load in the required content.
If you have any query please let me know.
link?el.click(). I.e. Faking a user click.onhashchange?window.location.href = link?