Commit 180e3af7 by Giulio Gratta

Name full-screen-image setup function and call it

This change sets up "Full Screen Image" JS everytime courseware tabs are clicked, as they are js/templates and not available in the DOM on page load.
parent 9c030168
$(function() { function setupFullScreenImage() {
// Set up on page load
$("a.modal-content").each(function() { $("a.modal-content").each(function() {
var smallImageObject = $(this).children(); var smallImageObject = $(this).children();
var largeImageSRC = $(this).attr('href'); var largeImageSRC = $(this).attr('href');
...@@ -106,4 +104,4 @@ $(function() { ...@@ -106,4 +104,4 @@ $(function() {
$(".wrapper-modal-image .image-content .image-controls .modal-ui-icon").toggleClass('is-disabled'); $(".wrapper-modal-image .image-content .image-controls .modal-ui-icon").toggleClass('is-disabled');
} }
}); });
}); }
\ No newline at end of file
...@@ -4,4 +4,5 @@ metadata: ...@@ -4,4 +4,5 @@ metadata:
data: | data: |
<h2>Full Screen Image</h2> <h2>Full Screen Image</h2>
<p>Use the full screen image tool to allow students to open the image in the full screen, zoom in on the image, and drag the image within the screen.</p> <p>Use the full screen image tool to allow students to open the image in the full screen, zoom in on the image, and drag the image within the screen.</p>
<a href="http://static.class.stanford.edu/stanford-hills-big.jpg" class="modal-content"><img alt="The Stanford Hills" src="http://static.class.stanford.edu/stanford-hills-small.jpg" /></a> <a href="http://static.class.stanford.edu/stanford-hills-big.jpg" class="modal-content"><img alt="The Stanford Hills" src="http://static.class.stanford.edu/stanford-hills-small.jpg" /></a>
\ No newline at end of file <script>$(function () {setupFullScreenImage();});</script>
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