Commit 33c3358f authored by Porter Libby's avatar Porter Libby
Browse files

add popup window

parent 4ef75c25
......@@ -151,4 +151,29 @@ body{
iframe{
float: right;
margin: 32px 40px;
}
#detail-popup{
width:100%;
height: 100%;
position:fixed;
z-index: 200;
top:0px;
}
#close-detect{
position: absolute;
z-index: 100;
width: 100%;
height: 100%;
}
#detail-container{
width:90%;
height: 80%;
background-color: rgba(255,255,255,0.8);
top:0px;
margin:5%;
position: absolute;
z-index: 101;
}
\ No newline at end of file
var popup_nav = '<button onclick="close_frame()" >X</button>'
function section_two(val){ // load info for section two based on value
var desc = dictionary["passion project"][val][0];
var video = dictionary["passion project"][val][1];
document.getElementById('block-2-frame').src = video;
}
function create_frame(text){ // use array of strings to create an iframe popup with content
var frame = document.createElement('div');
frame.id = 'detail-popup'
var html = '<div id="detail-container">'
html += popup_nav;
html += text;
html +='</div>';
html += '<div id="close-detect" onclick="close_frame()"></div>';
popup_nav;
frame.innerHTML = html
document.body.appendChild(frame);
}
function close_frame(){
var frame = document.getElementById('detail-popup');
frame.parentNode.removeChild(frame);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment