From 17ea2112a90a48e29275cb6f07633c2b9669c212 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 19 Jun 2008 13:27:44 +0000 Subject: Added a hover-over menu, which can be added to by plugins. git-svn-id: https://code.elgg.org/elgg/trunk@994 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/profile.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 mod/profile/profile.js (limited to 'mod/profile/profile.js') diff --git a/mod/profile/profile.js b/mod/profile/profile.js new file mode 100644 index 000000000..278793c27 --- /dev/null +++ b/mod/profile/profile.js @@ -0,0 +1,48 @@ + + /** + * Elgg profile javascript library + * + * @package ElggProfile + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Ben Werdmuller + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + * + */ + +function remove_user_menu() { + + $("#user_menu").hover(function() {}, function () { + $("#user_menu").remove(); + }); + +}; + +$(document).ready(function () { + + $("a.icon").hover(function(e) { + + var userdescription = this.rel; + + var dwidth = $(document).width(); + + $("body").append("
"+ userdescription + "
"); + + var top = e.pageY - 10; + var left = e.pageX - 10; + + if ((left + 10 + $("#user_menu").width()) > (dwidth - 10)) { + left = dwidth - $("#user_menu").width() - 50; + } + + $("#user_menu") + .css("top",(top) + "px") + .css("left",(left) + "px") + .fadeIn("medium"); + + + remove_user_menu(); + + }); + +}); \ No newline at end of file -- cgit v1.2.3