Team:TU Delft/header2
From 2010.igem.org
(Difference between revisions)
Line 28: | Line 28: | ||
<!-- Scripting - START /--> | <!-- Scripting - START /--> | ||
- | + | <script type="text/javascript" src="http://github.com/cowboy/jquery-hashchange/raw/v1.3/jquery.ba-hashchange.js"></script> | |
- | + | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 38: | Line 37: | ||
$(function() { | $(function() { | ||
// Initialize history plugin. | // Initialize history plugin. | ||
- | $. | + | $.hashchange(historyCallback); |
rewriteLinks($("#navlist")); | rewriteLinks($("#navlist")); | ||
- | + | /* | |
// set onlick event for menu buttons | // set onlick event for menu buttons | ||
$("#wrapper a").click(function(){ | $("#wrapper a").click(function(){ | ||
Line 48: | Line 47: | ||
return false; | return false; | ||
}); | }); | ||
- | + | */ | |
// setup hovering | // setup hovering | ||
$(".menu_button").hover( | $(".menu_button").hover( | ||
Line 82: | Line 81: | ||
} | } | ||
- | function historyCallback( | + | function historyCallback() { |
+ | var hash = location.hash; | ||
console.log('historyCallback: ' + hash); | console.log('historyCallback: ' + hash); | ||
- | |||
if(hash) { | if(hash) { | ||
+ | hash = hash.substring(1); | ||
if(hash.split('=').length == 1) { | if(hash.split('=').length == 1) { | ||
console.log('load hash as page: ' + hash); | console.log('load hash as page: ' + hash); | ||
Line 94: | Line 94: | ||
console.log('load hashmap.page: ' + kvmap.page); | console.log('load hashmap.page: ' + kvmap.page); | ||
loadPage(kvmap.page); | loadPage(kvmap.page); | ||
- | |||
- | |||
- | |||
} | } | ||
} | } |
Revision as of 17:58, 22 July 2010