From a64eb136b0d8710ff132551f149a39b3a45da1f9 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Mon, 23 Jun 2014 23:38:55 +0800 Subject: Updated traffic and introduction pages. * Small updates to introduction page. * Updated traffic page: - traffic routes - new metro map * Used bootstrap modal plugin to view images for traffic page - traffic.js - traffic.css --- page/static/js/traffic.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 page/static/js/traffic.js (limited to 'page/static/js/traffic.js') 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 = ''; + 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); + }); + }); +}); + -- cgit v1.2.2