diff --git a/modal/app.js b/modal/app.js index e69de29..5bb66c9 100644 --- a/modal/app.js +++ b/modal/app.js @@ -0,0 +1,49 @@ +$(document).ready(function () { + + //Modal popup + //Activate modal when button is pressed + $('.modal_trigger').click(function(){ + + //get the number (ID) of the modal window and store it in the name attribute of the trigger + var modal_num = $(this).attr('name'); + + //call function to show the modal + show_modal(modal_num); + + }); + + $('.close_modal').click(function(){ + + //call function to close the modal by clicking anywhere on the overlay + close_modal(); + + }); + +}); + +function close_modal() { + + //hide the modal popup + $('.modal_popup').fadeOut(600); + //hide the overlay + $('#modal_overlay').fadeOut(600); + +} + +function show_modal(modal_num) { + + $('#modal_overlay').css({ 'display' : 'block', opacity : 0}); //set the modal overlay opacity to 0 so we can fade it into view next + $('.modal_popup').css({'display' : 'block', opacity : 0}); //set the modal popup opacity to 0 so we can fade it into view next + + //fade in the overlay to 80% opacity + $('#modal_overlay').fadeTo(600, 0.8); + //fade in popup + $('.modal_popup').fadeTo(600, 1); + + //show the modal window + $('#'+modal_num).fadeIn(600); + +} + + + diff --git a/modal/index.html b/modal/index.html index 3f5a285..35d0372 100644 --- a/modal/index.html +++ b/modal/index.html @@ -10,16 +10,19 @@
+ - + - -
- On June 30, 2004, the Cassini spacecraft entered orbit around Saturn to begin the first in-depth, up-close study of the ringed planet and its domain. As expected, the Saturn System has provided an incredible wealth of opportunities for exploration and discovery. With its initial four-year tour of the Saturn system complete as well as an initial two-year extended mission called the Cassini Equinox Mission, the spacecraft is conducting a second extended mission called the Cassini Solstice Mission.
-"We're looking at a string of remarkable discoveries -- about Saturn's magnificent rings, its amazing moons, its dynamic magnetosphere and about Titan's surface and atmosphere," says Dr. Linda Spilker, Cassini project scientist. "Some of the mission highlights so far include discovering that Titan has Earth-like processes and that the small moon Enceladus has a hot-spot at its southern pole, jets on the surface that spew out ice crystals and evidence of liquid water beneath its surface."
- Read more about the mission - +
+ On June 30, 2004, the Cassini spacecraft entered orbit around Saturn to begin the first in-depth, up-close study of the ringed planet and its domain. As expected, the Saturn System has provided an incredible wealth of opportunities for exploration and discovery. With its initial four-year tour of the Saturn system complete as well as an initial two-year extended mission called the Cassini Equinox Mission, the spacecraft is conducting a second extended mission called the Cassini Solstice Mission.
+"We're looking at a string of remarkable discoveries -- about Saturn's magnificent rings, its amazing moons, its dynamic magnetosphere and about Titan's surface and atmosphere," says Dr. Linda Spilker, Cassini project scientist. "Some of the mission highlights so far include discovering that Titan has Earth-like processes and that the small moon Enceladus has a hot-spot at its southern pole, jets on the surface that spew out ice crystals and evidence of liquid water beneath its surface."
+ Read more about the mission + +