Created
February 8, 2023 01:47
-
-
Save weyou/99ec44c6528ca814bdbb5bbcd67f82c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="openModal">Open Modal</button> | |
<div id="modal" class="modal"> | |
<div class="modal-content"> | |
<span class="close">×</span> | |
<div class="iframe-container"> | |
<iframe src="https://www.example.com/iframe1"></iframe> | |
<iframe src="https://www.example.com/iframe2"></iframe> | |
</div> | |
</div> | |
</div> | |
.modal { | |
display: none; | |
position: fixed; | |
z-index: 1; | |
left: 0; | |
top: 0; | |
width: 100%; | |
height: 100%; | |
overflow: auto; | |
background-color: rgb(0,0,0); | |
background-color: rgba(0,0,0,0.4); | |
} | |
.modal-content { | |
background-color: #fefefe; | |
margin: 15% auto; | |
padding: 20px; | |
border: 1px solid #888; | |
width: 80%; | |
height: 80%; | |
} | |
.iframe-container { | |
display: flex; | |
} | |
.iframe-container iframe { | |
flex: 1; | |
width: 50%; | |
height: 100%; | |
} | |
.close { | |
color: #aaa; | |
float: right; | |
font-size: 28px; | |
font-weight: bold; | |
} | |
.close:hover, | |
.close:focus { | |
color: black; | |
text-decoration: none; | |
cursor: pointer; | |
} | |
let modal = document.getElementById("modal"); | |
let openModal = document.getElementById("openModal"); | |
let close = document.getElementsByClassName("close")[0]; | |
openModal.addEventListener("click", () => { | |
modal.style.display = "block"; | |
}); | |
close.addEventListener("click", () => { | |
modal.style.display = "none"; | |
}); | |
window.addEventListener("click", event => { | |
if (event.target == modal) { | |
modal.style.display = "none"; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reference: http://eyalarubas.com/python-subproc-nonblock.html
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
class AsyncReader:
class EndOfStream(Exception):
pass