You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7 KiB
JavaScript

5 years ago
$(document).ready(function(){
5 years ago
5 years ago
// index page
var modal = document.getElementById("myModal"); //$("#myModal");
var btn = document.getElementById("button");
var btn_bar = document.getElementById("button-right");
var tos_iframe = document.getElementById("tosview");
// Get the <span> element that closes the modal
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";
});
// btn.onclick = function() {
// console.log('btn was clicked');
// modal.style.display = "block";
// }
//right bar list
btn_bar.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
tos_iframe.src = tos_iframe.src;
}
// index page
var t_modal = document.getElementById("t_myModal");
var t_btn = document.getElementById("t_button");
var t_btn_bar = document.getElementById("t_button-right");
var treaty_iframe = document.getElementById("treatyview");
// Get the <span> element that closes the modal
var t_span = document.getElementsByClassName("t_close")[0];
// When the user clicks the button, open the modal
t_btn.onclick = function() {
t_modal.style.display = "block";
}
//right bar list
t_btn_bar.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
t_span.onclick = function() {
t_modal.style.display = "none";
treaty_iframe.src = treaty_iframe.src;
}
})