aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/profile.js
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile/profile.js')
-rw-r--r--mod/profile/profile.js48
1 files changed, 48 insertions, 0 deletions
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 <ben@curverider.co.uk>
+ * @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("<div id='user_menu'>"+ userdescription + "</div>");
+
+ 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