Difference between revisions of "Team:Pasteur Paris/test"

Line 4: Line 4:
 
<script type="text/javascript">
 
<script type="text/javascript">
 
//Function for hidding/showing elemnts
 
//Function for hidding/showing elemnts
function toggle(anId)
+
function toggle(anId){
{
+
 
node = document.getElementById(anId);
 
node = document.getElementById(anId);
 
if (node.style.display=="none")
 
if (node.style.display=="none")
Line 19: Line 18:
 
node.style.height = "0"; // Optionnel libérer l'espace
 
node.style.height = "0"; // Optionnel libérer l'espace
 
}
 
}
 +
}
 +
function hideALL(){
 +
  //Solution peu propre.
 +
  //TODO: foreach with querySelectotAll
 +
  document.getElementById(#week1).style.display = "none";
 +
 
}
 
}
 
</script>
 
</script>
Line 35: Line 40:
 
</select>
 
</select>
 
<script type="text/javascript">
 
<script type="text/javascript">
 +
//Enable jQuery chosen
 
jQuery(".chosen").chosen({
 
jQuery(".chosen").chosen({
 
     disable_search_threshold:10,
 
     disable_search_threshold:10,
Line 40: Line 46:
 
     width: "95%"
 
     width: "95%"
 
});
 
});
 
+
//Fonction de détection d'un changement dans le champ recherche
 
$(".chosen").chosen().change(function(event) {
 
$(".chosen").chosen().change(function(event) {
 +
    //Hide everything
 +
    hideALL();
 
     var Countries = $("#select-chosen").chosen().val();
 
     var Countries = $("#select-chosen").chosen().val();
 
     alert(Countries);
 
     alert(Countries);

Revision as of 09:11, 17 July 2015

Notebook

Search for a content: