iframe jquery
parent
7a388e6d59
commit
49f79a0074
@ -1,50 +1,66 @@
|
|||||||
// index page
|
$(document).ready(function(){
|
||||||
var modal = document.getElementById("myModal");
|
|
||||||
var btn = document.getElementById("button");
|
// index page
|
||||||
var btn_bar = document.getElementById("button-right");
|
var modal = document.getElementById("myModal"); //$("#myModal");
|
||||||
var tos_iframe = document.getElementById("tosview");
|
var btn = document.getElementById("button");
|
||||||
|
var btn_bar = document.getElementById("button-right");
|
||||||
// Get the <span> element that closes the modal
|
var tos_iframe = document.getElementById("tosview");
|
||||||
var span = document.getElementsByClassName("close")[0];
|
|
||||||
// When the user clicks the button, open the modal
|
// Get the <span> element that closes the modal
|
||||||
btn.onclick = function() {
|
var span = document.getElementsByClassName("close")[0];
|
||||||
|
// When the user clicks the button, open the modal
|
||||||
|
|
||||||
|
$( ".button-tos" ).click(function() {
|
||||||
|
var text = $(this).text().toLowerCase() + '.html';
|
||||||
|
console.log(text);
|
||||||
|
|
||||||
|
$('iframe#tosview').attr('src', text);
|
||||||
modal.style.display = "block";
|
modal.style.display = "block";
|
||||||
}
|
|
||||||
//right bar list
|
|
||||||
btn_bar.onclick = function() {
|
});
|
||||||
|
|
||||||
|
// btn.onclick = function() {
|
||||||
|
// console.log('btn was clicked');
|
||||||
|
// modal.style.display = "block";
|
||||||
|
// }
|
||||||
|
|
||||||
|
//right bar list
|
||||||
|
btn_bar.onclick = function() {
|
||||||
modal.style.display = "block";
|
modal.style.display = "block";
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the user clicks on <span> (x), close the modal
|
// When the user clicks on <span> (x), close the modal
|
||||||
span.onclick = function() {
|
span.onclick = function() {
|
||||||
modal.style.display = "none";
|
modal.style.display = "none";
|
||||||
tos_iframe.src = tos_iframe.src;
|
tos_iframe.src = tos_iframe.src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// index page
|
// index page
|
||||||
var t_modal = document.getElementById("t_myModal");
|
var t_modal = document.getElementById("t_myModal");
|
||||||
var t_btn = document.getElementById("t_button");
|
var t_btn = document.getElementById("t_button");
|
||||||
var t_btn_bar = document.getElementById("t_button-right");
|
var t_btn_bar = document.getElementById("t_button-right");
|
||||||
var treaty_iframe = document.getElementById("treatyview");
|
var treaty_iframe = document.getElementById("treatyview");
|
||||||
|
|
||||||
// Get the <span> element that closes the modal
|
// Get the <span> element that closes the modal
|
||||||
var t_span = document.getElementsByClassName("t_close")[0];
|
var t_span = document.getElementsByClassName("t_close")[0];
|
||||||
// When the user clicks the button, open the modal
|
// When the user clicks the button, open the modal
|
||||||
t_btn.onclick = function() {
|
t_btn.onclick = function() {
|
||||||
t_modal.style.display = "block";
|
t_modal.style.display = "block";
|
||||||
}
|
}
|
||||||
//right bar list
|
//right bar list
|
||||||
t_btn_bar.onclick = function() {
|
t_btn_bar.onclick = function() {
|
||||||
modal.style.display = "block";
|
modal.style.display = "block";
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the user clicks on <span> (x), close the modal
|
// When the user clicks on <span> (x), close the modal
|
||||||
t_span.onclick = function() {
|
t_span.onclick = function() {
|
||||||
t_modal.style.display = "none";
|
t_modal.style.display = "none";
|
||||||
treaty_iframe.src = treaty_iframe.src;
|
treaty_iframe.src = treaty_iframe.src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
Loading…
Reference in New Issue