Team:Grenoble/script
From 2012.igem.org
(Difference between revisions)
m |
|||
(24 intermediate revisions not shown) | |||
Line 26: | Line 26: | ||
</script> | </script> | ||
- | <script type="text/javascript"> | + | <!--<script type="text/javascript"> |
$(document).ready( | $(document).ready( | ||
function(){ | function(){ | ||
Line 32: | Line 32: | ||
function() { | function() { | ||
// Hover over | // Hover over | ||
- | $(this).parent().find("ul. | + | $(this).parent().find("ul.submenu").hide(); |
- | $(this).find("ul. | + | $(this).find("ul.submenu").show(); |
// Hover out | // Hover out | ||
$(this).hover( | $(this).hover( | ||
Line 39: | Line 39: | ||
}, | }, | ||
function(){ | function(){ | ||
- | $(this).find("ul. | + | $(this).find("ul.submenu").hide(); |
} | } | ||
); | ); | ||
}, | }, | ||
function(){ | function(){ | ||
- | $(this).find("ul. | + | $(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(); | ||
} | } | ||
Line 51: | Line 77: | ||
); | ); | ||
</script> | </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> | ||
+ | |||
+ | |||
</html> | </html> |
Latest revision as of 00:10, 26 September 2012