From f4a3d0b205c02dcbaca233d78bffeab840803b03 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 24 Jun 2009 18:55:40 +0200 Subject: [PATCH] Add some javascript for the exodus homepage. --- static/exodus/js/homepage.js | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 static/exodus/js/homepage.js diff --git a/static/exodus/js/homepage.js b/static/exodus/js/homepage.js new file mode 100644 index 0000000..7731298 --- /dev/null +++ b/static/exodus/js/homepage.js @@ -0,0 +1,38 @@ +var active = false; + +//changes the preview image +function switchCloseup(to) { + /* Deselect all closeups */ + $(".closeup div").removeClass('selected'); + /* Select the wanted one */ + $(".closeup div." + to).addClass('selected'); +} + +//hides all previewcontent and reveales the selected info +function switchInfo(cls) { + /* Deselect all summaries */ + $(".summary div").removeClass('selected'); + /* Select the wanted one */ + $(".summary div." + cls).addClass('selected'); + /* Save the selected area to reset to on mouseout */ + active = cls; +} + +//after loading the document do this: +$(document).ready( function () { + $("area").mouseout (function (){ + /* Switch back to the selected area */ + switchCloseup(active); + }); + + $("area").mousemove (function (){ + /* Switch to the area we're hovering over */ + switchCloseup($(this).attr('class')); + }); + + $("area").click (function (){ + /* Select a different area */ + switchInfo($(this).attr('class')); + return false; + }); +}); -- 2.30.2