Template:Team:Trieste/menu

From 2012.igem.org

(Difference between revisions)
(fix js)
(fix home menu)
Line 65: Line 65:
             </ul>
             </ul>
    <script type="text/javascript">
    <script type="text/javascript">
-
$(function(){
+
$(function(){
-
    title_regexp = /http:\/\/2012\.igem\.org\/Team:Trieste\/([a-zA-Z]+).*/;
+
    title_regexp = /http:\/\/2012\.igem\.org\/Team:Trieste\/([a-zA-Z]+).*/;
-
    title = title_regexp.exec(location.href);
+
    title = title_regexp.exec(location.href);
-
    $('#navigation > li > a[href$=' + title[1] + ']').parent().addClass('select');
+
if (title === null){
-
    /* js menu */
+
$('#navigation > li:first').addClass('select');
-
    $('#navigation > li').hover(
+
} else {
-
function () {
+
    $('#navigation > li > a[href$=' + title[1] + ']').parent().addClass('select');
-
    //show its submenu
+
}
-
    $('ul', this).stop().show();
+
    /* js menu */
-
},  
+
    $('#navigation > li').hover(
-
function () {
+
function () {
-
    //hide its submenu
+
    //show its submenu
-
    $('ul', this).stop().hide();           
+
    $('ul', this).stop().show();
-
}
+
},  
-
    );
+
function () {
-
});
+
    //hide its submenu
 +
    $('ul', this).stop().hide();           
 +
}
 +
    );
 +
});
    </script>
    </script>
             <a href="http://socialigem.ning.com" target="_blank"><img src="/wiki/images/5/5c/Trieste-SocialiGEM.png" alt="SocialiGEM" class="logo-socialigem" /></a>
             <a href="http://socialigem.ning.com" target="_blank"><img src="/wiki/images/5/5c/Trieste-SocialiGEM.png" alt="SocialiGEM" class="logo-socialigem" /></a>

Revision as of 13:54, 26 September 2012