2014-07-06 13:21:10 +02:00
|
|
|
(function () {
|
|
|
|
var sbFunc = function(link, box) {
|
|
|
|
jQuery(link).click(function() {
|
|
|
|
var elt = jQuery(box);
|
|
|
|
elt.css("left", Math.min( jQuery(this).position().left, jQuery(window).width() - elt.outerWidth(true) - 5))
|
|
|
|
.css("top", jQuery(this).position().top + jQuery(this).outerHeight(true))
|
|
|
|
.toggle();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
jQuery(box).on("mouseleave click", function() {
|
|
|
|
jQuery(this).hide();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
if (window.SwitchBox) {
|
|
|
|
for (var i=0; i<SwitchBox.length; i+=2)
|
|
|
|
sbFunc(SwitchBox[i], SwitchBox[i+1]);
|
|
|
|
}
|
|
|
|
|
2016-08-27 21:53:29 +02:00
|
|
|
window.SwitchBox = {
|
2014-07-06 13:21:10 +02:00
|
|
|
push: sbFunc
|
|
|
|
}
|
|
|
|
})();
|