diff options
Diffstat (limited to '')
-rw-r--r-- | themes/default/js/switchbox.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/themes/default/js/switchbox.js b/themes/default/js/switchbox.js new file mode 100644 index 000000000..9e8167a33 --- /dev/null +++ b/themes/default/js/switchbox.js @@ -0,0 +1,11 @@ +function switchBox(link, box) { + jQuery(link).click(function() { + var elt = jQuery(box); + elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) + .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) + .toggle(); + }); + jQuery(box).on("mouseleave click", function() { + jQuery(this).hide(); + }); +}
\ No newline at end of file |