Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (25 sloc) 863 Bytes
<html>
<head>
<script src="./jquery-1.8.2.min.js"></script>
<script src="./jquery.ba-hashchange.js"></script>
</head>
<body>
<div id="page1" style="background-color: orange; height: 600px">
<a href="#page2">Go to page 2</a>
</div>
<div id="page2" style="background-color: hotpink; height: 600px">
<a href="#page1">Go to page 1</a>
</div>
<script>
$( document ).ready( function() {
var start;
$( "body" ).on( "click", "a", function() {
start = new Date().getTime();
});
$( window ).on( "hashchange", function() {
alert( "hashchange took: " + (new Date().getTime() - start) + "ms" );
});
});
</script>
</body>
</html>