aboutsummaryrefslogtreecommitdiffstats
path: root/page/static/js/traffic.js
diff options
context:
space:
mode:
Diffstat (limited to 'page/static/js/traffic.js')
-rw-r--r--page/static/js/traffic.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/page/static/js/traffic.js b/page/static/js/traffic.js
new file mode 100644
index 0000000..34400c5
--- /dev/null
+++ b/page/static/js/traffic.js
@@ -0,0 +1,25 @@
+/*
+ * traffic.js
+ * used with 'traffic.html' page
+ *
+ * 2014/06/23
+ */
+
+/* bootstrap 3 built-in modal plugin */
+$(document).ready(function() {
+ $("img.modal-images").on("click", function() {
+ var src = $(this).attr('src');
+ var img_html = '<img src="'+src+'" class="img-responsive">';
+ var orig_html = $('#imageviewer-modal .modal-body').html();
+ // modal
+ $('#imageviewer-modal').modal('toggle');
+ // action
+ $('#imageviewer-modal').on('shown.bs.modal', function() {
+ $('#imageviewer-modal .modal-body').html(img_html);
+ });
+ $('#imageviewer-modal').on('hidden.bs.modal', function() {
+ $('#imageviewer-modal .modal-body').html(orig_html);
+ });
+ });
+});
+