mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
switchBox("selector for link", "selector for box");
git-svn-id: http://piwigo.org/svn/trunk@23320 68402e56-0260-453c-a942-63ccdbb3a9ee
11 lines
386 B
JavaScript
11 lines
386 B
JavaScript
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();
|
|
});
|
|
} |