Ich benutze auf meinem Blog (http://lrvkoeln.de/Tests/LRV/) ein Child von "twentytwelve", das mir einen Extra-Sidebar ermöglicht, und einen Content Slider (http://dimsemenov.com/plugins/royal-slider/documentation/) um meine Posts darzustellen.
Bei bestimmten Slides brauche ich ein Menü mit simplen Links im Extra-Sidebar. Dazu möchte ich folgendes Script benutzen:
Code
<script type="text/javascript">
var hash = false;
checkHash();
function checkHash(){
if(window.location.hash != hash) {
hash = window.location.hash;
processHash(hash);
} t=setTimeout("checkHash()",400);
}
function processHash(hash){
if (window.location.hash == "#page-1") {
$("#textwidget ul").empty();
}
if (window.location.hash == "#page-2") {
$('#textwidget ul').html('<li><a href="#Geschichte">Geschichte</a></li><li><a href="#Vorstand">Vorstand</a></li><li><a href="#Anlage">Anlage</a></li><li><a href="#Mitglied">Mitglied werden</a></li>');
}
if (window.location.hash == "#page-3") {
$("#textwidget ul").empty();
}
if (window.location.hash == "#page-4") {
$("#textwidget ul").html('<li><a href="/user/messages">Musi Center</a></li><li><a href="/user/messages">Manga Center</a></li>');
}
if (window.location.hash == "#page-5") {
$("#textwidget ul").html('<li><a href="/user/messages">Multivitamin Center</a></li><li><a href="/user/messages">Mutti Center</a></li>');
}
if (window.location.hash == "#page-6") {
$("#textwidget ul").empty();
}
if (window.location.hash == "#page-7") {
$("#textwidget ul").empty();
}
if (window.location.hash == "#page-8") {
$("#textwidget ul").empty();
}
}
</script>
Alles anzeigen
Es ist mit
PHP
<script src="<?php echo get_template_directory_uri(); ?>/js/sidebarmenus.js" type="text/javascript"></script>
in den Header meiner Header.php eingebunden.
Leider tut sich da gar nichts. Was mache ich falsch?