Team:Grenoble/script
From 2012.igem.org
(Difference between revisions)
(120 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | + | $(document).ready( | |
- | (function( | + | function(){ |
- | + | $("ul.topnav li").hover( | |
+ | function() { | ||
+ | // Hover over | ||
+ | $(this).parent().find("ul.subnav").hide(); | ||
+ | $(this).find("ul.subnav").show(); | ||
+ | // Hover out | ||
+ | $(this).hover( | ||
+ | function() { | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("ul.subnav").hide(); | ||
+ | } | ||
+ | ); | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("ul.subnav").hide(); | ||
+ | } | ||
- | + | ); | |
- | + | } | |
- | + | ); | |
- | + | </script> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <!--<script type="text/javascript"> | |
- | + | $(document).ready( | |
- | + | function(){ | |
+ | $("ul.menu li").hover( | ||
+ | function() { | ||
+ | // Hover over | ||
+ | $(this).parent().find("ul.submenu").hide(); | ||
+ | $(this).find("ul.submenu").show(); | ||
+ | // Hover out | ||
+ | $(this).hover( | ||
+ | function() { | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("ul.submenu").hide(); | ||
+ | } | ||
+ | ); | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("ul.submenu").hide(); | ||
+ | } | ||
- | + | ); | |
- | + | } | |
- | + | ); | |
- | + | </script>--> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | <script type="text/javascript"> | |
- | + | $(document).ready( | |
- | + | function(){ | |
- | + | $("ul.mini li").hover( | |
- | + | function() { | |
- | + | // Hover over | |
- | + | $(this).parent().find("ul.maxi").hide(); | |
- | + | $(this).find("ul.maxi").show(); | |
- | + | // Hover out | |
- | + | $(this).hover( | |
- | + | function() { | |
- | + | }, | |
- | + | function(){ | |
- | + | $(this).find("ul.maxi").hide(); | |
- | + | } | |
- | + | ); | |
- | + | }, | |
+ | function(){ | ||
+ | $(this).find("ul.maxi").hide(); | ||
+ | } | ||
- | + | ); | |
- | + | } | |
- | + | ); | |
- | + | </script> | |
- | + | ||
- | + | ||
- | + | ||
- | + | <!--<script type="text/javascript"> | |
- | + | $(document).ready( | |
- | + | function(){ | |
- | + | $("demo").hover( | |
- | + | function() { | |
+ | // Hover over | ||
+ | $(this).parent().find("to_hide").hide(); | ||
+ | $(this).find("to_hide").show(); | ||
+ | // Hover out | ||
+ | $(this).hover( | ||
+ | function() { | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("to_hide").hide(); | ||
+ | } | ||
+ | ); | ||
+ | }, | ||
+ | function(){ | ||
+ | $(this).find("to_hide").hide(); | ||
+ | } | ||
- | + | ); | |
- | + | } | |
- | + | ); | |
- | + | </script>--> | |
- | + | ||
- | + | ||
- | + | ||
- | + | <script type="text/javascript"> | |
- | + | function swap_div(my_div, my_object) | |
- | + | { | |
+ | if (document.getElementById(my_div).style.display == "none") | ||
+ | { | ||
+ | document.getElementById(my_div).style.display = "all"; | ||
+ | my_object.value = "Cacher"; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | document.getElementById(my_div).style.display = "none"; | ||
+ | my_object.value = "Afficher"; | ||
+ | } | ||
+ | } | ||
+ | </script> | ||
- | |||
- | |||
- | |||
- | + | <script type="text/javascript"> | |
+ | // Méthode pour changer la visiblité d'une balise dont l'ID est passée en paramètre | ||
+ | function toggleVisibility(tagId) { | ||
+ | if (!document.getElementById) { | ||
+ | msg = 'Votre navigateur est trop ancien pour profiter de votre visite\n'; | ||
+ | msg += 'Veuillez le mettre à jour ou vous en procurer un autre'; | ||
+ | return false; | ||
+ | } | ||
+ | var tagToToggle; | ||
+ | try { // On tente de récupérer la balise cible dont on doit changer la visibilité | ||
+ | tagToToggle = document.getElementById(tagId); | ||
+ | } catch (e) { // Si échec de la récupération de la balise cible | ||
+ | alert('Je n\'ai pas pu trouver la balise cible'); | ||
+ | } | ||
+ | try { // Seulement pour les non IE | ||
+ | if (tagToToggle.style.display == 'none') { | ||
+ | tagToToggle.style.display = 'inline'; | ||
+ | } else { | ||
+ | tagToToggle.style.display = 'none'; | ||
+ | } | ||
+ | } catch (e) { | ||
+ | } | ||
+ | // Pour IE | ||
+ | if (tagToToggle.style.visibility == 'hidden') { | ||
+ | tagToToggle.style.visibility = 'visible'; | ||
+ | } else { | ||
+ | tagToToggle.style.visibility = 'hidden'; | ||
+ | } | ||
+ | } | ||
</script> | </script> | ||
+ | |||
+ | |||
</html> | </html> |
Latest revision as of 00:10, 26 September 2012