Difference between revisions of "Team:Uppsala"

Line 536: Line 536:
  
 
var modal = document.querySelector(".modal");
 
var modal = document.querySelector(".modal");
     var trigger = document.querySelector(".trigger");
+
     var trigger1 = document.querySelector(".trigger");
 
     var closeButton = document.querySelector(".close-button");
 
     var closeButton = document.querySelector(".close-button");
  
Line 552: Line 552:
 
     closeButton.addEventListener("click", toggleModal);
 
     closeButton.addEventListener("click", toggleModal);
 
     window.addEventListener("click", windowOnClick);
 
     window.addEventListener("click", windowOnClick);
 +
 +
 +
 +
 +
 +
 +
var modal = document.querySelector(".modal");
 +
    var trigger2 = document.querySelector(".trigger");
 +
    var closeButton = document.querySelector(".close-button");
 +
 +
    function toggleModal() {
 +
        modal.classList.toggle("show-modal");
 +
    }
 +
 +
    function windowOnClick(event) {
 +
        if (event.target === modal) {
 +
            toggleModal();
 +
        }
 +
    }
 +
 +
    trigger.addEventListener("click", toggleModal);
 +
    closeButton.addEventListener("click", toggleModal);
 +
    window.addEventListener("click", windowOnClick);
 +
 +
 +
 +
 +
 +
 +
 +
 +
var modal = document.querySelector(".modal");
 +
    var trigger3 = document.querySelector(".trigger");
 +
    var closeButton = document.querySelector(".close-button");
 +
 +
    function toggleModal() {
 +
        modal.classList.toggle("show-modal");
 +
    }
 +
 +
    function windowOnClick(event) {
 +
        if (event.target === modal) {
 +
            toggleModal();
 +
        }
 +
    }
 +
 +
    trigger.addEventListener("click", toggleModal);
 +
    closeButton.addEventListener("click", toggleModal);
 +
    window.addEventListener("click", windowOnClick);
 +
 +
 +
 
</script>
 
</script>
  

Revision as of 09:39, 12 October 2018





Uppsala iGEM 2018